Solution (source code)

= Solution

For a spherical <stellar polytrope> with $P=K\rho^{1+1/n}$, the <Lane-Emden equation> gives
$$
R\propto K^{1/2}\rho_c^{(1-n)/(2n)},
\qquad
M\propto K^{3/2}\rho_c^{(3-n)/(2n)}.
$$
Eliminating the central density at fixed composition and entropy gives the <polytropic mass-radius relation>
$$
\boxed{R\propto M^\beta,\qquad
\beta=\frac{1-n}{3-n}}.
$$
An incompressible rocky body has $n=0$ and $\beta=1/3$. A moderately massive gas giant is approximately an $n=1$ polytrope and has $\beta=0$, explaining its weak radius dependence on mass. In a more strongly degenerate nonrelativistic regime, $n=3/2$ gives $\beta=-1/3$.