Solution (source code)

= Solution

Assume the lower atmosphere is optically thick, hydrogen-helium dominated, convective, and approximately ideal with constant $\gamma=7/5$. The convective temperature gradient is the dry adiabat
$$
\boxed{\frac{d\log T}{d\log P}
=\nabla_{\rm ad}=\frac{\gamma-1}{\gamma}=\frac27}.
$$
If $T_0$ is the temperature at $P_0=0.1\,{\rm bar}$ at the base of the inverted stratosphere, then
$$
\boxed{T(P)=T_0\left(\frac{P}{P_0}\right)^{2/7}},
\qquad
\boxed{\frac{dT}{dP}=\frac27\frac TP}.
$$
In a radiative lower layer with constant upward flux $F$ and Rosseland opacity $\kappa_R$, diffusion would instead give
$$
\frac{dT}{dP}=\frac{3\kappa_RF}{16g\sigma T^3}.
$$
The actual profile follows the shallower stable radiative gradient until it exceeds the adiabatic value, where convection begins.