Solution (source code)

= Solution

For a spherical <star> in Newtonian <hydrostatic equilibrium>, the total supporting <pressure> satisfies
$$
\frac{dP}{dr}=-\frac{Gm(r)\rho(r)}{r^2},\qquad P(R)=0,
$$
where zero external <pressure> is the idealized vacuum boundary condition. Substitute the enclosed <mass> from <2/a>, set $x=ar$, and integrate inwards:
$$
P(r)=\frac{4\pi G\rho_c^2}{a^2}
\int_{ar}^{\pi}\frac{\sin x(\sin x-x\cos x)}{x^3}\,dx.
$$
The supplied <integral> follows directly by differentiating $\tfrac12(\sin x/x)^2$. It yields
$$
\boxed{P(r)=\frac{2\pi G\rho_c^2}{a^2}
\left(\frac{\sin ar}{ar}\right)^2
=\frac{2GR^2}{\pi}\rho(r)^2.}
$$
Thus $P_c=\pi GM^2/(8R^4)$, about $4.42\times10^{14}\,\mathrm{Pa}$ for the <Sun>'s parameters. This is precisely the <equation of state> of a <polytrope of index one>.

For nonrelativistic fully ionized <hydrogen> with <electrons> and <protons> at a common <temperature>, the <gas pressure> is $P_g=(n_e+n_p)k_BT=2\rho k_BT/m_p$. If <gas pressure> dominates, the resulting <temperature> profile is
$$
\boxed{T_g(r)=\frac{m_pP(r)}{2k_B\rho(r)}
=T_c\frac{\sin ar}{ar},\qquad
T_c=\frac{GMm_p}{4Rk_B}.}
$$
Numerically $T_c\simeq5.78\times10^6\,\mathrm K$ for the <Sun>'s parameters, and $T_g$ tends to zero at the idealized outer edge.

If the <photons> are additionally assumed to be in <local thermodynamic equilibrium> with this gas, their <radiation pressure> is $a_{\rm rad}T^4/3$, with $a_{\rm rad}=4\sigma_{\rm SB}/c$. The consistent <temperature> is instead the unique nonnegative root of
$$
\boxed{\frac{2\rho(r)k_B}{m_p}T(r)+\frac{a_{\rm rad}}3T(r)^4=P(r).}
$$
The left side is strictly increasing in $T$ for $r<R$, so the root is unique. Evaluating the <radiation pressure> at $T_g$ gives at most $P_{\rm rad}/P\simeq6.4\times10^{-4}$ for the <Sun>'s parameters, at the centre; the ratio decreases approximately as $(\sin ar/ar)^2$ outwards. The gas-only profile is consequently an excellent approximation \i[within this imposed stellar model].

<Hydrostatic equilibrium> by itself fixes total <pressure>, not how it is divided between gas and radiation. <Thomson scattering> alone does not enforce a common gas–radiation <temperature> or a <Planck photon distribution>. Without either neglecting <radiation pressure> or specifying the radiation field and its thermodynamic closure, a unique gas <temperature> cannot be inferred from the given <mass density> alone.