Solution (source code)

= Solution

Let $r$ be radial position, $\mathcal F=L/(4\pi r^2)$ the outward radiative energy <flux>, and $P_r=aT^4/3$ the <radiation pressure>. A thin layer absorbs a fraction $\kappa\rho\,dr$ of an incident directed beam. Since a <photon> carries <momentum> $E/c$, the outward force per unit volume deposited by the <radiation> is $\kappa\rho\mathcal F/c$. Balance it against the <radiation pressure> gradient:
$$
\frac{dP_r}{dr}=-\frac{\kappa\rho}{c}\mathcal F
=-\frac{\kappa\rho L}{4\pi r^2c}.
$$
Substituting $dP_r/dr=(4a/3)T^3dT/dr$ yields the <radiative diffusion> equation
$$
\boxed{L=-4\pi r^2\frac{4ac}{3\kappa\rho}T^3\frac{dT}{dr}.}
$$
The sign expresses outward energy <flux> down the <temperature> gradient. The approximation assumes optically thick material and near local thermodynamic equilibrium, with an appropriate mean <opacity>.

The printed attenuation law describes the loss from an incident beam; it is not generally the radial derivative of the net <luminosity>, since absorption is accompanied by emission. For a concrete counterexample, in a steady envelope without local energy generation the net <luminosity> is constant even though $\kappa\rho>0$ and $dT/dr<0$. Applying $dL/dr=-\kappa\rho L$ to that net <luminosity> would contradict energy conservation. The local <momentum> deposition argument supplies the physically correct derivation.