A generalized vertical coordinate $\mu$ is defined by a transformation $\mu\leftrightarrow z$. This illustration is i. A. depends on the horizontal coordinates: $z = z\left(\varphi, \lambda, \mu\right)$. For a scalar field $\psi$ is written in geographical coordinates with geodetic or generalized vertical coordinates
\[ \begin{align} \psi\left(\varphi, \lambda, z\left(\varphi, \lambda, \mu\right)\right) = \newtilde{\psi}\left(\varphi, \lambda, \mu\right), \end{align} \]
so follows for the gradients in these coordinates
\[ \begin{align} \nabla\psi &= \left(\begin{array}{c} \frac{\partial\psi}{\partial\varphi}\\ \frac{\partial\psi}{\partial\lambda}\\ \frac{\partial\psi}{\partial z} \end{array}\right),\\ \nabla\newtilde{\psi} &= \left(\begin{array}{c} \frac{\partial\newtilde{\psi}}{\partial\varphi}\\ \frac{\partial\newtilde{\psi}}{\partial\lambda}\\ \frac{\partial\newtilde{\psi}}{\partial\mu} \end{array}\right). \end{align} \]
It applies
\[ \begin{align} \frac{\partial\newtilde{\psi}}{\partial\lambda} &= \frac{d}{d\lambda}\psi\left(\varphi, \lambda, z\left(\varphi, \lambda, \mu\right)\right) = \nabla\psi\cdot\left( \begin{array}{c} \frac{d\varphi}{d\lambda}\\ \frac{d\lambda}{d\lambda}\\ \frac{dz}{d\lambda} \end{array}\right) = \nabla\psi\cdot\left(\begin{array}{c} 0\\ 1\\ \frac{\partial\psi}{\partial z} \frac{\partial z}{\partial\lambda} \end{array}\right) = \frac{\partial\psi}{\partial\lambda} + \frac{\partial z}{\partial\lambda}\frac{\partial\psi}{\partial z}. \end{align} \]
The derivatives with respect to $\lambda$ are proportional to the derivatives with respect to $x$. This follows
\[ \begin{align} \frac{\partial\newtilde{\psi}}{\partial x} = \frac{\partial\psi}{\partial x} + \frac{\partial z}{\partial x}\frac{\partial\psi}{\partial z}. \end{align} \]
If you ignore the difference between $\psi$ and $\newtilde{\psi}$ in the notation and instead mark variables that are kept constant with indices, you get
\[ \begin{align} \left(\frac{\partial\psi}{\partial x}\right) _\mu &= \left(\frac{\partial\psi}{\partial x}\right)_z + \left(\frac{\partial z}{\partial x}\right)_\mu\frac{\partial\psi}{\partial z}.\tag{12.6}\label{eq:z_to_gen} \end{align} \]
$z$ and $\mu$ are interchangeable in the derivation, so the same applies
\[ \begin{align} \left(\frac{\partial\psi}{\partial x}\right) _z &= \left(\frac{\partial\psi}{\partial x}\right)_\mu + \left(\frac{\partial \mu}{\partial x}\right)_z\frac{\partial\psi}{\partial \mu}.\tag{12.7}\label{eq:trans_gen_2} \end{align} \]
Partial derivatives $\frac{\partial}{\partial x}, \frac{\partial}{\partial z}$ occur in the governing equations; up to now, $z$ was used as the vertical coordinate. If you want to transform to a generalized coordinate $\mu$, you use the chain rule and set Eq. (12.6) at:
\[ \begin{align} \frac{\partial\psi}{\partial z} &= \frac{\partial\mu}{\partial z}\frac{\partial\psi}{\partial\mu}\tag{12.8}\label{eq:trans_gen_4}\\ \left(\frac{\partial\psi}{\partial x}\right)_z &= \left(\frac{\partial\psi}{\partial x}\right)_\mu - \left(\frac{\partial z}{\partial x}\right)_\mu\frac{\partial\mu}{\partial z}\frac{\partial\psi}{\partial\mu}\tag{12.9}\label{eq:trans_gen_5} \end{align} \]
Analogously also in the y direction. The material derivative $\md{}$ is independent of the vertical coordinate. However, the horizontal material derivative $\md{_h}$ (see equation (B.12)) depends on the coordinate system. $z$ is not distinguished in the above derivation, so $z$ can be replaced by any vertical coordinate $\nu$.
In the p-system, the pressure $p$ is used as the vertical coordinate, which is possible with hydrostatics ($\frac{\partial p}{\partial z} = -g\rho\not = 0$, see section 13.7). For the total derivative in the p-system then applies
\[ \begin{align} \md{\psi} = \frac{\partial\psi}{\partial t} + u\frac{\partial\psi}{\partial x} + v\frac{\partial\psi}{\partial y} + \omega\frac{\partial\psi}{\partial p}. \end{align} \]
Here $\omega \coloneqq\md{p}$ is the vertical velocity in the p-system. In Section 13.7 the governing equations are transformed into the p-system.
In a thermally stable stratified atmosphere, $\theta$ can be used as a generalized vertical coordinate. In addition, hydrostatics is assumed here. This is called $\theta-$system or also as isentropic coordinates. If you write down the equations (12.8) - (12.9) with $\mu = \theta$, it follows
\[ \begin{align} \frac{\partial\psi}{\partial z} &= \frac{\partial\theta}{\partial z}\frac{\partial\psi}{\partial\theta},\\ \left(\frac{\partial\psi}{\partial x}\right)_z &= \left(\frac{\partial\psi}{\partial x}\right)_\theta - \left(\frac{\partial z}{\partial x}\right)_\theta\frac{\partial\theta}{\partial z}\frac{\partial\psi}{\partial\theta} = \left(\frac{\partial\psi}{\partial x}\right)_\theta + \rho\left(\frac{\partial\phi}{\partial x}\right)_\theta\frac{\partial\theta}{\partial p}\frac{\partial\psi}{\partial\theta},\\ \left(\frac{\partial\psi}{\partial y}\right)_z &= \left(\frac{\partial\psi}{\partial y}\right)_\theta - \left(\frac{\partial z}{\partial y}\right)_\theta\frac{\partial\theta}{\partial z}\frac{\partial\psi}{\partial\theta} = \left(\frac{\partial\psi}{\partial y}\right)_\theta + \rho\left(\frac{\partial\phi}{\partial y}\right)_\theta\frac{\partial\theta}{\partial p}\frac{\partial\psi}{\partial\theta}. \end{align} \]
In the case $\psi = p$ it follows
\[ \begin{align} \left(\frac{\partial p}{\partial x}\right)_z &= \left(\frac{\partial p}{\partial x}\right)_\theta - \left(\frac{\partial z}{\partial x}\right)_\theta\frac{\partial\theta}{\partial z}\frac{\partial p}{\partial\theta} = \left(\frac{\partial p}{\partial x}\right)_\theta + \rho\left(\frac{\partial\phi}{\partial x}\right)_\theta. \end{align} \]
It applies
\[ \begin{align} p &= \rho R_d\theta\left(\frac{p}{p_0}\right)^{\frac{R_d}{c^{(p)}}}\nonumber\\ \Rightarrow \left(\frac{\partial p}{\partial x}\right)_\theta &= R_d\theta\left(\frac{p}{p_0}\right)^{\frac{R_d}{c^{(p)}}}\left(\frac{\partial\rho}{\partial x}\right)_\theta + \rho R_d\theta\frac{1}{p_0^{\frac{R_d}{c^{(p)}}}}\frac{R_d}{c^{(p)}}p^{\frac{R_d}{c^{(p)}} - 1}\left(\frac{\partial p}{\partial x}\right)_\theta\nonumber\\ &= R_dT\left(\frac{\partial\rho}{\partial x}\right)_\theta + \rho R_d\theta\left(\frac{p}{p_0}\right)^{\frac{R_d}{c^{(p)}}}\frac{R_d}{c_pp}\left(\frac{\partial p}{\partial x}\right)_\theta\nonumber\\ &= R_dT\left(\frac{\partial\rho}{\partial x}\right)_\theta + \rho R_dT\frac{R_d}{c^{(p)}\rho R_dT}\left(\frac{\partial p}{\partial x}\right)_\theta\nonumber\\ &= R_dT\left(\frac{\partial\rho}{\partial x}\right)_\theta + \frac{R_d}{c^{(p)}}\left(\frac{\partial p}{\partial x}\right)_\theta\nonumber\\ \Rightarrow \left(\frac{\partial p}{\partial x}\right)_\theta &= \frac{c^{(p)}R_dT}{c^{(V)}}\left(\frac{\partial\rho}{\partial x}\right)_\theta = \frac{c^{(p)}}{c^{(V)}}T\left(\frac{\partial}{\partial x}\left(\frac{p}{T}\right)\right)_\theta\nonumber\\ &= \frac{c^{(p)}}{c^{(V)}}T\left(\frac{1}{T}\frac{\partial p}{\partial x} - \frac{p}{T^2}\frac{\partial T}{\partial x}\right) = \frac{c^{(p)}}{c^{(V)}}\left(\frac{\partial p}{\partial x}\right)_\theta - \frac{c^{(p)}}{c^{(V)}}\frac{p}{T}\left(\frac{\partial T}{\partial x}\right)_\theta\nonumber\\ &= \frac{c^{(p)}}{c^{(V)}}\left(\frac{\partial p}{\partial x}\right)_\theta - \frac{c^{(p)}}{c^{(V)}}\rho R_d\left(\frac{\partial T}{\partial x}\right)_\theta\nonumber\\ \Rightarrow \frac{R_d}{c^{(V)}}\left(\frac{\partial p}{\partial x}\right)_\theta &= \frac{c^{(p)}}{c^{(V)}}\rho R_d\left(\frac{\partial T}{\partial x}\right)_\theta \Rightarrow \left(\frac{\partial p}{\partial x}\right)_\theta = c^{(p)}\rho\left(\frac{\partial T}{\partial x}\right)_\theta. \end{align} \]
Thus you get
\[ \begin{align} \frac{1}{\rho}\left(\frac{\partial p}{\partial x}\right)_z = \frac{\partial}{\partial x}\left(c^{(p)}T + \phi\right), \end{align} \]
where on the right-hand side the partial derivative is carried out in the $\theta-$system. You define
\[ \begin{align} M \coloneqq c^{(p)}T + \phi \end{align} \]
as the Montgomery potential.
With $h$ as orography and $H$ as the upper edge of the atmosphere, one defines the orographic coordinate $\sigma_z$ by
\[ \begin{align} \sigma_z \coloneqq\frac{z - h}{H - h} \Leftrightarrow z = h + \sigma_z\left(H - h\right), \end{align} \]
follow from this
\[ \begin{align} \frac{\partial\sigma_z}{\partial z} &= \frac{1}{H - h},\\ \left(\frac{\partial z}{\partial x}\right)_{\sigma_z} &= \left(1 - \sigma_z\right)\frac{\partial h}{\partial x},\\ \left(\frac{\partial z}{\partial x}\right)_{\sigma_z}\frac{\partial\sigma_z}{\partial z} &= \frac{1 - \sigma_z}{H - h}\frac{\partial h}{\partial x}. \end{align} \]
Using $p_S$ as the surface pressure and $p_T$ as the pressure at the top of the atmosphere, one defines another orographic coordinate $\sigma_p$ by
\[ \begin{align} \sigma_p \coloneqq\frac{p - p_T}{p_S - p_T} \Leftrightarrow p = p_T + \sigma_p\left(p_S - p_T\right), \end{align} \]
follow from this
\[ \begin{align} \frac{\partial\sigma_p}{\partial p} &= \frac{1}{p_S - p_T},\\ \left(\frac{\partial p}{\partial x}\right)_{\sigma_p} &= \sigma_p\frac{\partial p_S}{\partial x},\\ \left(\frac{\partial p}{\partial x}\right)_{\sigma_p}\frac{\partial\sigma_p}{\partial z} &= \frac{\sigma_p}{p_S - p_T}\frac{\partial p_S}{\partial x}. \end{align} \]