Solution (source code)

= Solution

Write $x=ar=\pi r/R$. The <mass density> has a finite central value because $\sin x/x\to1$ as $x\to0$, is monotonically decreasing on $0<x<\pi$, and first vanishes at $r=R$. Near the centre, $\rho/\rho_c=1-\pi^2r^2/(6R^2)+O(r^4/R^4)$; near the surface, $\rho/\rho_c\simeq(R-r)/R$. It is zero outside. The enclosed <mass> is
$$
m(r)=4\pi\int_0^r s^2\rho(s)\,ds
=\frac{4\pi\rho_c}{a^3}(\sin x-x\cos x).
$$
Consequently $M=m(R)=4\pi^2\rho_c/a^3=4\rho_cR^3/\pi$, so
$$
\boxed{\rho_c=\frac{\pi M}{4R^3},\qquad
\frac{\rho_c}{\bar\rho}=\frac{\pi^2}{3},\qquad
\bar\rho=\frac{3M}{4\pi R^3}.}
$$
This is the <polytrope of index one> profile. Its derivative is negative because $\sin x-x\cos x>0$ for $0<x<\pi$: the latter function vanishes at zero and has derivative $x\sin x>0$.

\Image[/past-exam-of-the-radiative-processes-and-high-energy-astrophysics-course-of-the-university-of-oxford/2024-stellar-density-and-free-path.png]
{title=The index-one stellar density profile and the diverging Thomson-scattering mean free path}