= Solution
Let $\rho_g(r)$ be the gas density and $M(<r)$ the total gravitating mass. For a spherically symmetric gas in <hydrostatic equilibrium>, radial force balance is
$$
\frac{dP}{dr}=-\rho_g\frac{GM(<r)}{r^2}.
$$
Using the <ideal gas law> $P=\rho_gk_BT/(\mu m_p)$, with constant <mean molecular weight> $\mu$, differentiate the product rather than setting $T$ constant:
$$
\frac{dP}{dr}=\frac{k_BT\rho_g}{\mu m_pr}
\left(\frac{d\log\rho_g}{d\log r}+\frac{d\log T}{d\log r}\right).
$$
Substitution and cancellation of $\rho_g$ give the <cluster hydrostatic mass estimator>
$$
\boxed{M(<r)=-\frac{k_BT(r)r}{\mu m_pG}
\left[\frac{d\log\rho_g}{d\log r}+\frac{d\log T}{d\log r}\right].}
$$
Here $k_B$ is the <Boltzmann constant>, denoted $K$ in the question. The prefactor has units of mass; a pressure decreasing outward makes the bracket negative and the inferred mass positive. For an isothermal gas with $\rho_g\propto r^{-\beta}$, this reduces to $M(<r)=\beta k_BTr/(\mu m_pG)$. The density in the logarithmic derivative is the gas density, not the total density. A varying $\mu$ or nonthermal pressure would require the corresponding extra terms.
Back to article page