Solution (source code)

= Solution

For a unit mass of <ideal gas>, the <first law of thermodynamics> in enthalpy form is $\delta Q=c_p\,dT-v\,dp$. A reversible adiabatic displacement has $\delta Q=0$, and the <ideal gas law> gives $v=RT/p$. Thus
$$
\frac{dT}{T}=\frac R{c_p}\frac{dp}{p},\qquad
\boxed{T(p)=T_0(p/p_0)^\gamma,\quad \gamma=R/c_p.}
$$
The atmospheric profile approaches this <dry adiabat> when <convection> efficiently mixes potential <temperature> and there is no <condensation> or other strong diabatic source. The first law by itself determines a parcel path, not every possible environmental <Temperature>[temperature profile]; the <Convection>[convective mixing] assumption is needed. <Hydrostatic equilibrium>[Hydrostatic balance] gives the corresponding height lapse rate $dT/dz=-g/c_p$.

For rigid linear molecules with translation and rotation active but vibration frozen, the molecular <Heat capacity>[heat capacities] are $C_V=(5/2)R_u$ and $C_P=(7/2)R_u$, hence $R/c_p=2/7$. <Earth> is dominated by the diatomic gases nitrogen and oxygen. <Mars> is dominated by carbon dioxide, which is triatomic but linear and has the same two <Equipartition theorem>[rotational degrees of freedom]. In the rigid-molecule approximation it therefore has the same ratio. The value is not exact for carbon dioxide when its bending vibrations contribute appreciably to <heat capacity>, and variable <Heat capacity>[heat capacities] give a nonconstant dry-adiabatic exponent. Here $\gamma$ denotes $R/c_p$, not the distinct adiabatic index $c_p/c_v$.