Solution (source code)

= Solution

For a quasistatic spherical <star> with fixed total mass, the <stellar structure equations> in radius are
$$
\boxed{\frac{dM_r}{dr}=4\pi r^2\rho,\qquad\frac{dP}{dr}=-\frac{GM_r\rho}{r^2},\qquad\frac{dL_r}{dr}=4\pi r^2\rho\left(\varepsilon_{\rm nuc}-\varepsilon_\nu-T\frac{Ds}{Dt}\right),\qquad\frac{dT}{dr}=\frac TP\nabla\frac{dP}{dr}.}
$$
Here $s$ is the <specific entropy> of a moving mass shell, and the <entropy> term accounts for release or storage of thermal and gravitational <energy>. In thermal equilibrium it vanishes. An <equation of state>, <opacity>, energy-generation law and composition evolution close the equations. The absence of mass loss fixes the outer mass coordinate; it does not require the <star> to be in thermal equilibrium.

The <radiative temperature gradient> needed to carry the full <luminosity> is
$$
\nabla_{\rm rad}=\frac{3\kappa L_rP}{16\pi a_{\rm rad}cGM_rT^4}.
$$
Here the actual <temperature gradient> is $\nabla=d\log T/d\log P$. For uniform composition the <Schwarzschild criterion> says that a radiative layer is stable if $\nabla_{\rm rad}<\nabla_{\rm ad}$, with marginal stability at equality, where the <adiabatic temperature gradient> is $(\partial\log T/\partial\log P)_s$. Use $\nabla=\nabla_{\rm rad}$ there. If $\nabla_{\rm rad}>\nabla_{\rm ad}$, <convection> carries some of the flux. Efficient <convection> gives $\nabla\simeq\nabla_{\rm ad}$; inefficient surface <convection> needs a transport prescription and can be superadiabatic. For composition gradients, use the <Ledoux criterion>, with threshold $\nabla_{\rm ad}+\phi\nabla_{\mu_{\rm mol}}/\delta_{\rm th}$ instead. Here $\nabla_{\mu_{\rm mol}}=d\log\mu_{\rm mol}/d\log P$, $\phi=(\partial\log\rho/\partial\log\mu_{\rm mol})_{P,T}$ and $\delta_{\rm th}=-(\partial\log\rho/\partial\log T)_{P,\mu_{\rm mol}}$, using the <mean molecular weight> $\mu_{\rm mol}$.

Above the thin burning shell, take constant <luminosity> $L$, constant <mean molecular weight> $\mu_{\rm mol}$, ideal-gas <pressure> $P=\mathcal RT\rho$ with $\mathcal R=k_B/(\mu_{\rm mol}m_u)$, and the <Kramers' opacity law> $\kappa=\kappa_0\rho T^{-7/2}$. Then the <temperature> equation is
$$
\frac{dT}{dr}=-\frac{3\kappa_0L}{16\pi a_{\rm rad}c}\frac{\rho^2}{r^2T^{13/2}}.
$$
To implement the printed assumption that $P,\rho$ and $M_r$ are all <power laws> while retaining mass conservation, write $M_r\propto r^m$, $\rho\propto r^b$, $P\propto r^p$ and $T\propto r^d$. The mass equation gives $m=b+3$; the <ideal gas> law gives $d=p-b$; <hydrostatic equilibrium> gives $d=m-1$. The diffusion equation gives $d-1=2b-2-13d/2$. Solving this linear system gives the <self-gravitating Kramers power-law envelope>:
$$
\boxed{M_r\propto r^{1/11},\qquad\rho\propto r^{-32/11},\qquad P\propto r^{-42/11},\qquad T\propto r^{-10/11}.}
$$
The coefficients can also be matched consistently. If $r_c$ is the core boundary and $M_c$ its <enclosed mass>,
$$
M_r=M_c\left(\frac r{r_c}\right)^{1/11},\qquad\rho(r)=\frac{M_r}{44\pi r^3},\qquad T(r)=\frac{11}{42}\frac{GM_r}{\mathcal Rr},\qquad P=\mathcal R\rho T.
$$
<Radiative transfer> fixes the constant <luminosity> through
$$
L=\frac{160\pi a_{\rm rad}c}{33\kappa_0}\frac{rT^{15/2}}{\rho^2},
$$
whose right-hand side is independent of radius for these exponents. Thus this is a solution of all four envelope equations, not just a dimensional estimate.

Matching the boundary <temperature> to the isothermal core and extrapolating the idealized <power law> to the specified <photosphere> gives
$$
\boxed{\frac R{r_c}=\left(\frac{10^7}{4000}\right)^{11/10}=2500^{11/10}\simeq5.47\times10^3.}
$$
For reference $M_R/M_c=(R/r_c)^{1/11}=2500^{1/10}\simeq2.19$, so the envelope mass is not negligible in this particular solution. The given $M_c\simeq M_\odot$ fixes the core-radius normalization $r_c=(11/42)GM_c/(\mathcal R10^7\,\mathrm K)$; a numerical absolute radius needs the unspecified molecular weight. The exponent ratio also gives $\nabla=d/p=5/21<2/5$, so the fully ionized monatomic version of this idealization is convectively stable.

A different common approximation neglects the envelope's self-gravity and sets $M_r\simeq M_c$ in the force equation. It cannot obey the exact mass equation with a nonzero density and exactly constant $M_r$. Under that additional approximation, the same calculation instead gives
$$
T\propto r^{-1},\quad\rho\propto r^{-13/4},\quad P\propto r^{-17/4},\qquad\boxed{R/r_c\simeq2500.}
$$
This is the constant-core-mass <power-law opacity radiative envelope> limit, not the full power-law solution with changing <enclosed mass>. Stating which approximation is used resolves the otherwise different numerical radius ratios.

A compact nearly isothermal core, a thin luminosity-producing shell and a much larger cool envelope describe a shell-burning <red giant>. The full power-law profile is a deliberately simple model. The <Kramers' opacity law> and an ionized <ideal gas> are not reliable at a $4000\,\mathrm K$ <photosphere>; partial ionization, other <opacity> sources and a <convective envelope> usually modify real cool giants. The quoted radius ratios are extrapolations within the stipulated model.