Solution (source code)

= Solution

For an isotropic <velocity dispersion>, $\langle v^2\rangle=3\sigma_{\rm los}^2$. To specify the order-unity structure factor, approximate the gravitating system by a uniform sphere, whose <gravitational potential energy> is $W=-3GM^2/(5R)$. The <virial theorem> gives
$$
\boxed{M_{\rm dyn}\simeq\frac{5R\sigma_{\rm los}^2}{G}\simeq9.4\times10^{14}M_\odot.}
$$
The numerical value uses $R=1\,\mathrm{Mpc}$ and $\sigma_{\rm los}=900\,\mathrm{km\,s^{-1}}$. Different mass profiles change the prefactor, rather than the scaling $R\sigma^2/G$.

For fully ionized intracluster gas, take mean particle mass $\mu m_p$ with $\mu\simeq0.6$. In the same uniform-sphere virial estimate, replace $\sigma^2$ by $k_BT/(\mu m_p)$ to obtain
$$
\boxed{M_X\simeq\frac{5Rk_BT}{G\mu m_p}\simeq3.2\times10^{15}M_\odot.}
$$
Alternatively, <hydrostatic equilibrium> gives $M(<R)=-k_BTR(G\mu m_p)^{-1}(d\log\rho_g/d\log r+d\log T/d\log r)$. An isothermal gas with density proportional to $r^{-2}$ gives $1.3\times10^{15}M_\odot$. The supplied radius and temperature do not specify the profile, so the meaningful inference is a mass of order $10^{15}M_\odot$, with the displayed model choices making the coefficient explicit. The high supplied temperature need not yield the same estimate as the galaxy dispersion in a crude single-profile calculation.

The stellar estimate is much smaller:
$$
\boxed{M_*\simeq1000(5\times10^9)(3)M_\odot=1.5\times10^{13}M_\odot.}
$$
It counts luminous stellar matter, rather than all matter in the cluster.