---
title: "How hot gas weighs a galaxy cluster in hydrostatic equilibrium"
description: "Derive the hydrostatic mass from gas density and temperature, define the cluster edge, and see how gas motion, clumping, SZ scattering and lensing enter."
canonical_url: "https://sandboxphysics.com/stories/cluster-mass-calibration/hydrostatic-mass-from-x-rays/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/cluster-mass-calibration/hydrostatic-mass-from-x-rays/"
last_modified: "2026-11-22"
---

[Weighing galaxy clusters with X-rays, SZ and lensing](https://sandboxphysics.com/stories/cluster-mass-calibration/)

# How hot gas weighs a galaxy cluster in hydrostatic equilibrium

Sandbox Physics · 2026-11-22

If the gas in a cluster is at rest, its pressure gradient balances gravity, and the mass inside radius $r$ is $M(<r)=-(kTr/G\mu m_{\rm p})\,(\mathrm d\ln n/\mathrm d\ln r+\mathrm d\ln T/\mathrm d\ln r)$. X-ray spectra give the density $n$ and temperature $T$ at each radius, so the mass follows. When part of the support comes from gas motion, this thermal-only mass falls short by roughly the non-thermal share of the pressure. This chapter derives the formula, works one example, and shows how SZ scattering and lensing measure the same cluster in other ways.

Before this chapter, read [why X-rays, the SZ effect and lensing weigh a cluster differently](https://sandboxphysics.com/stories/cluster-mass-calibration/three-ways-to-weigh-a-cluster/). You need the ideal gas law, Newton's law of gravitation, and derivatives of logarithms.

## What an X-ray telescope measures

Intracluster gas is a fully ionised plasma of hydrogen and helium with a few heavier elements, at temperatures $kT$ of 2 to 10 keV, or 20 to 120 million kelvin. Electrons deflected by ions emit bremsstrahlung, braking radiation. The power per unit volume scales as $n_{\rm e}n_{\rm i}\sqrt{T}$ times a factor of order unity, and the photon spectrum falls off as $e^{-E/kT}$. Two things follow:

- The shape of the spectrum gives $kT$. A cutoff near 5 keV means gas near 5 keV.
- The brightness, after the temperature is known, gives the emission measure, the integral of $n_{\rm e}n_{\rm p}$ along the line of sight. Deprojecting rings of emission yields $n_{\rm e}(r)$.

Both come from photons, and the photons come mostly from where $n^2$ is large. Keep that in mind for the section on clumping.

## Hydrostatic equilibrium

Take a thin shell of gas at radius $r$, thickness $\mathrm dr$ and area $A$. Gravity from the mass $M(<r)$ inside pulls it inward with force $G M\rho A\,\mathrm dr/r^2$. The pressure below the shell exceeds the pressure above by $-\mathrm dP$, pushing outward with force $-A\,\mathrm dP$. Balance gives

$$
\frac{\mathrm dP}{\mathrm dr}=-\frac{G M(<r)\,\rho}{r^2}.
$$

For an ideal gas, $P=nkT$ with $n$ the total particle density, and $\rho=\mu m_{\rm p} n$, where $\mu\approx0.61$ is the mean particle mass in proton masses for a fully ionised gas with cosmic helium. Substituting and writing derivatives in logarithmic form,

$$
M(<r)=-\frac{kT\,r}{G\mu m_{\rm p}}\left(\frac{\mathrm d\ln n}{\mathrm d\ln r}+\frac{\mathrm d\ln T}{\mathrm d\ln r}\right).
$$

This is the formula Vikhlinin and colleagues used for their Chandra sample of relaxed clusters, where $n$ and $T$ come from fitted smooth profiles. [Chandra sample of nearby relaxed galaxy clusters, Sect. 3.4](https://arxiv.org/abs/astro-ph/0507092v1) Two features stand out. The mass depends on the temperature and on logarithmic slopes, not on the density's normalisation. A calibration error that multiplies all densities by a constant changes nothing; one that multiplies all temperatures by $s_T$ multiplies the mass by $s_T$.

**Worked example 1.** An isothermal gas with $n\propto r^{-2}$ has slopes $-2$ and $0$, so $M(<r)=2kTr/(G\mu m_{\rm p})$. With $kT=5$ keV and $r=1$ Mpc: $kT=8.01\times10^{-16}$ J, $r=3.086\times10^{22}$ m and $G\mu m_{\rm p}=6.81\times10^{-38}$ in SI units, giving $M=7.26\times10^{44}$ kg, or $3.6\times10^{14}$ solar masses.

**Worked example 2.** Near the usual cluster edge, density slopes are close to $-2.5$ and temperature slopes close to $-0.5$. With $kT=6$ keV at $r=1.3$ Mpc, the bracket is $-3$ and the mass is $8.5\times10^{14}$ solar masses.

## Defining the cluster edge

A cluster has no surface. By convention, $R_{500}$ is the radius inside which the mean density is 500 times the critical density of the Universe at the cluster's redshift, $\rho_{\rm c}(z)=3H(z)^2/8\pi G$, and $M_{500}=\tfrac43\pi R_{500}^3\cdot500\rho_{\rm c}$. To find it from data, compute $M(<r)$ from the formula above and step outward until it equals $\tfrac43\pi r^3\cdot500\rho_{\rm c}$. Because the defining condition itself depends on mass, a mass that is too low also gives an $R_{500}$ that is too small.

## Pressure the X-rays cannot see

Suppose the gas also has random bulk motions with velocity dispersion $\sigma$ along each axis. They push like an extra pressure $P_{\rm nt}=\rho\sigma^2$. The full balance uses $P_{\rm tot}=P_{\rm th}+P_{\rm nt}$. Write $\alpha(r)=P_{\rm nt}/P_{\rm tot}$, so $P_{\rm th}=(1-\alpha)P_{\rm tot}$. An analysis that uses only $P_{\rm th}$ finds

$$
\frac{M_{\rm th}}{M_{\rm true}}=1-\alpha+\frac{\mathrm d\alpha/\mathrm d\ln r}{s},\qquad s=-\frac{\mathrm d\ln P_{\rm tot}}{\mathrm d\ln r}.
$$

The first term is the missing share. The second appears because $\alpha$ grows outward in simulations: the thermal pressure then falls faster than the total, which steepens its gradient and partly offsets the loss. Nelson, Lau and Nagai fitted such $\alpha(r)$ profiles in simulated clusters. The fraction grows toward the outskirts and depends strongly on how fast the cluster is gaining mass. [Hydrodynamic simulation of non-thermal pressure profiles of galaxy clusters](https://arxiv.org/abs/1404.4636v3)

## Clumps brighten the X-ray sky

X-ray brightness follows $\langle n^2\rangle$, not $\langle n\rangle^2$. If the gas at a given radius is clumpy, with clumping factor $C=\langle n^2\rangle/\langle n\rangle^2$, the inferred density is $\sqrt C$ times too high. A constant $C$ leaves the hydrostatic mass unchanged, because only slopes enter. But it raises the gas mass by $\sqrt C$. If $C$ grows outward, the inferred density falls too slowly, the slope is too shallow, and the mass comes out low. In Nagai and Lau's simulated clusters, the median clumping factor is close to 1 inside half of $R_{200}$ and rises gradually beyond it; $R_{200}$ is defined like $R_{500}$ with 200 in place of 500 and lies about 1.5 times farther out. [Gas clumping in the outskirts of cold dark matter clusters](https://arxiv.org/abs/1103.0280v1)

## Two other ways to see the same cluster

Thermal SZ scattering. A microwave background photon crossing the cluster scatters off an electron with probability $\mathrm d\tau=n_{\rm e}\sigma_{\rm T}\mathrm dl$, where $\sigma_{\rm T}=6.65\times10^{-25}\ {\rm cm^2}$ is the Thomson cross-section. Each scattering raises its energy by a fraction of order $kT_{\rm e}/m_{\rm e}c^2$, about 1 percent at 5 keV. The distortion is set by the Compton parameter

$$
y=\frac{\sigma_{\rm T}}{m_{\rm e}c^2}\int P_{\rm e}\,\mathrm dl,
$$

the electron pressure added along the line of sight. For $n_{\rm e}=10^{-3}\ {\rm cm^{-3}}$ through 1 Mpc at 5 keV, $\tau=2.1\times10^{-3}$ and $y=2.0\times10^{-5}$. Like the X-ray mass, $y$ sees thermal pressure only. [Cosmology with the Sunyaev-Zel'dovich effect, Sect. 2.1](https://arxiv.org/abs/astro-ph/0208192v1)

Weak lensing. A background galaxy at projected radius $R$ is stretched tangentially by the shear

$$
\gamma_{\rm t}(R)=\frac{\bar\Sigma(<R)-\Sigma(R)}{\Sigma_{\rm cr}}=\frac{\Delta\Sigma(R)}{\Sigma_{\rm cr}},
$$

where $\Sigma$ is the projected total mass per area and $\Sigma_{\rm cr}=c^2D_{\rm s}/(4\pi GD_{\rm l}D_{\rm ls})$ depends on the distances to lens and source. For a cluster at $z=0.2$ and sources at $z=1$, $\Sigma_{\rm cr}=3250$ solar masses per square parsec. A $7\times10^{14}$ solar-mass cluster with a Navarro-Frenk-White profile has $\Delta\Sigma=144$ solar masses per square parsec at 1 Mpc, so $\gamma_{\rm t}=0.044$. Wright and Brainerd give the closed forms for that profile. [Gravitational lensing by NFW halos](https://arxiv.org/abs/astro-ph/9908213v1)

## Lab tasks

1. In [the cluster mass Lab](https://sandboxphysics.com/labs/galaxy-cluster-mass-calibration/), set the gas motion share of pressure to 0 and gas clumping to 1. Read the X-ray mass ratio. Then set the gas motion share to 0.2 and compare the ratio with $1-\alpha$.
2. Keep $\alpha=0$ and raise gas clumping to 1.5. Predict whether the X-ray mass ratio moves more or less than the gas fraction. Check the gas fraction in the extra readouts.
3. Choose the Cooler temperature scale preset, then Clumpy outskirts. Explain from the hydrostatic formula why the temperature scale moves the X-ray mass but leaves the SZ mass unchanged.

## Exercises

1. Show that a temperature calibration error $T_{\rm X}=s_TT$ multiplies the hydrostatic mass by exactly $s_T$.
2. For $\alpha(r)=0.2$ at all radii, what is $M_{\rm th}/M_{\rm true}$? Repeat for $\alpha$ rising from 0.15 to 0.25 over one e-fold in radius around $R_{500}$, with $s=3$.
3. A clumping factor rises as $C(r)=1+0.2(r/R_{500})^2$ near $R_{500}$. Estimate the fractional change in the hydrostatic mass at $R_{500}$ if the true slopes add to $-3$.
4. How many background galaxies with shape noise 0.25 are needed to measure $\gamma_{\rm t}=0.044$ to 10 percent in one radial bin?

Answers

1. Both slopes are unchanged by a constant factor, and the prefactor is linear in $T$, so $M\to s_TM$.
2. Constant $\alpha$ gives $1-\alpha=0.80$. In the second case $\alpha(R_{500})=0.20$ and $\mathrm d\alpha/\mathrm d\ln r=0.10$, so $M_{\rm th}/M_{\rm true}=0.80+0.10/3=0.83$. The rising profile loses less mass than a constant one with the same value at $R_{500}$.
3. $\ln C$ rises with slope $\mathrm d\ln C/\mathrm d\ln r=2\times0.2/1.2=0.33$ at $R_{500}$. The inferred density slope shifts by half of that, $+0.17$, so the bracket goes from $-3$ to $-2.83$ and the mass drops by about 6 percent.
4. Each galaxy measures $\gamma_{\rm t}$ with noise 0.25, so $N$ galaxies give $0.25/\sqrt N$. Setting this to $0.0044$ gives $N\approx3200$.

Next: [the SZ Compton parameter, lensing shear and a first computable cluster model](https://sandboxphysics.com/stories/cluster-mass-calibration/sz-pressure-and-lensing-shear/).

## Try it in the Lab

[Weighing a galaxy cluster three ways](https://sandboxphysics.com/labs/galaxy-cluster-mass-calibration/): Set the gas motion share to zero and confirm the X-ray mass ratio returns to 1.

## Sources

1. [Chandra sample of nearby relaxed galaxy clusters, Sect. 3.4](https://arxiv.org/abs/astro-ph/0507092v1)
2. [Hydrodynamic simulation of non-thermal pressure profiles of galaxy clusters](https://arxiv.org/abs/1404.4636v3)
3. [Gas clumping in the outskirts of cold dark matter clusters](https://arxiv.org/abs/1103.0280v1)
4. [Cosmology with the Sunyaev-Zel'dovich effect, Sect. 2.1](https://arxiv.org/abs/astro-ph/0208192v1)
5. [Gravitational lensing by NFW halos](https://arxiv.org/abs/astro-ph/9908213v1)

## Keep reading

Weighing galaxy clusters with X-rays, SZ and lensing · Reading path

### From three scales to cluster counts

1. [Article **Why X-rays, the SZ effect and lensing weigh a galaxy cluster differently**](https://sandboxphysics.com/stories/cluster-mass-calibration/three-ways-to-weigh-a-cluster/)
2. [You are here **How hot gas weighs a galaxy cluster in hydrostatic equilibrium**](https://sandboxphysics.com/stories/cluster-mass-calibration/hydrostatic-mass-from-x-rays/)
3. [Article **A first computable cluster model with SZ Compton y and lensing shear**](https://sandboxphysics.com/stories/cluster-mass-calibration/sz-pressure-and-lensing-shear/)
4. [Article **How a hydrostatic mass bias shifts cosmology from cluster counts**](https://sandboxphysics.com/stories/cluster-mass-calibration/mass-bias-and-cluster-counts/)
5. [Article **Recompute X-COP hydrostatic masses and a toy SZ cluster survey**](https://sandboxphysics.com/stories/cluster-mass-calibration/recompute-xcop-hydrostatic-masses/)
6. [Article **How to read the Planck 2015 SZ cluster counts and the mass bias**](https://sandboxphysics.com/stories/cluster-mass-calibration/reading-the-planck-cluster-count-mass-bias/)
