Solution (source code)

= Solution

Suppose first that the gas-pressure fraction $\beta=P_g/P$ is spatially constant, with $0<\beta<1$. This is a sufficient condition for a <stellar polytrope>. Since
$$
P_g=\frac{\rho k_BT^{1+s}}{\mu_1m_u},
\qquad
P_{\rm rad}=\frac{a_{\rm rad}T^4}{3},
$$
the ratio $P_{\rm rad}/P_g=(1-\beta)/\beta$ gives
$$
\rho=C_\beta T^{3-s},
\qquad
C_\beta=\frac{a_{\rm rad}\mu_1m_u}{3k_B}
\frac{\beta}{1-\beta}.
$$
Therefore
$$
P=\frac{a_{\rm rad}}{3(1-\beta)}T^4
=K\rho^{1+1/n},
$$
with
$$
\boxed{n=\frac{3-s}{1+s}},
\qquad
\boxed{
K(\beta)=\frac{a_{\rm rad}}{3(1-\beta)}
C_\beta^{-4/(3-s)}}.
$$
For an ordinary positive polytropic index one also assumes $0\leq s<3$.

The <radiative diffusion in a star> equation can be written as
$$
\frac{dP_{\rm rad}}{dr}
=-\frac{\kappa\rho L_r}{4\pi cr^2}.
$$
Because $P_{\rm rad}=(1-\beta)P$ and $\beta$ is constant, <hydrostatic equilibrium> gives
$$
\frac{dP_{\rm rad}}{dr}
=-(1-\beta)\frac{Gm_r\rho}{r^2}.
$$
Equating them and using $\eta=(L_r/L)/(m_r/M)$ yields
$$
\boxed{\kappa\eta=4\pi cG(1-\beta)\frac{M}{L}}.
$$