Mass Continuity Equation
A star is a self-gravitating ball of gas holding itself up against its own weight, and to describe what happens inside it we track how each physical quantity changes with distance from the centre. Of the four coupled relations that make up the theory of stellar structure, the mass continuity equation is the simplest and the most fundamental: it is nothing more than careful bookkeeping for mass. If we know the density at every radius, how much matter lies inside a sphere of radius ? The answer is built one thin shell at a time — a shell at radius of thickness has volume , so it holds mass , and summing all the shells reconstructs the whole star. Trivial as it looks, this equation is structurally indispensable. By Newton's shell theorem, the gravity felt at radius inside a spherical body depends only on the mass interior to , the quantity . Hydrostatic equilibrium therefore needs at every point, and mass continuity is precisely what supplies it — the two equations are coupled and cannot be solved apart. Add an equation of state, an energy-transport law, and the energy-generation equation, and the system closes into a complete model of a star. The stellar form is one static, spherical face of a far more general law. In a moving fluid, conservation of mass reads — the continuity equation Leonhard Euler wrote down for fluid dynamics in 1757. Switch off the flow and impose spherical symmetry, and it collapses to . That lineage links a stellar interior to accretion flows, stellar winds, and the smooth cosmological fluid whose density thins as the universe expands.
- The mass continuity equation, , says the enclosed mass grows in each spherical shell as its volume times the local density .
- It is the first of the four equations of stellar structure and supplies the interior mass that gravity — and hence hydrostatic equilibrium — depends on.
- Integrating from the centre outward gives the total mass; special density laws (uniform, power-law) make the integral explicit and show where the mass concentrates.
- The Lagrangian form makes enclosed mass the independent variable — the standard choice in every stellar-evolution code.
- It is the static, spherical special case of the general fluid continuity equation .
- Key idea: in a spherically symmetric star the mass enclosed within radius increases as the volume of each successive shell times its local density, — pure mass conservation, and the source of the interior mass on which all of stellar structure rests.
In a spherically symmetric star the mass enclosed within radius increases as the volume of each successive shell times its local density: . This is pure mass conservation, and it supplies the interior mass that gravity — and hence hydrostatic equilibrium — depends on.
Where this lives today
The mass continuity equation is not a museum piece — it is executed billions of times a second inside every modern stellar-evolution calculation. Codes such as MESA (Modules for Experiments in Stellar Astrophysics, first released in 2011 and now the community standard) solve the four structure equations on a Lagrangian mesh, with mass as the independent coordinate exactly as equation (3) prescribes: each zone carries a fixed slug of matter while the code lets the radius of that zone float, expanding it through the red-giant phase and squeezing it in a white-dwarf remnant. The fixed mass domain is what keeps such a calculation numerically stable across the enormous radius changes of a star's life, and adaptive re-meshing simply splits and merges mass zones. On the observational side, helioseismology — the study of the Sun's acoustic oscillations by instruments like SOHO/MDI and the ground-based GONG network — has measured the solar interior density profile to better than one percent over much of the radius, turning the abstract of equation (2) into a directly tested function; asteroseismology with the Kepler and TESS missions is now doing the same for thousands of other stars. And the same conservation principle, with the flow restored, governs spherical (Bondi) accretion onto compact objects through , stellar winds, and the diluting cosmic fluid of an expanding universe.
The physical picture
Picture assembling a star out of concentric, onion-like shells. A shell at radius with thickness has surface area and volume ; multiply by the density there and you have the mass that shell holds. Stack the shells from the centre outward and you rebuild the whole star, with the running total climbing from zero at the core to the full mass at the surface. Because gravity in a spherical body answers only to interior mass, that running total is the physically active quantity, and the continuity equation is the ledger that keeps it honest at every radius.
The steepness of the running total tells you where the mass actually lives. In a centrally condensed star the curve climbs steeply near the middle and flattens toward the surface, so most of the mass is buried deep inside even though most of the volume is in the outer envelope. The second figure makes this concrete by comparing two density laws whose integrals we can do by hand: a uniform sphere and a mildly centre-heavy linear model. The gap between the curves is the whole content of "centrally condensed", and the numbers attached to it — the Sun's mean density and the four-fold central enhancement of the linear model — are the kind of estimate this one equation delivers immediately.
The core equations
The differential equation is the local statement of mass conservation: the rate at which enclosed mass grows with radius equals the density times the surface area of the sphere at that radius. It is the workhorse form, used at every point in a stellar model.
where: — mass enclosed within radius ; — radial distance from the stellar centre; — local mass density; — surface area of a sphere of radius . Read it as: each shell contributes its own volume times what is packed into it. Integrating (1) from the centre out accumulates the running total, and evaluating at the surface returns the whole stellar mass. This is the global statement — the total mass is the volume integral of the density profile.
where: — dummy integration variable running from the centre to ; — the density profile. Setting gives , the total mass. Because a star's total mass barely changes over its life while its radius can swing by factors of hundreds, it is far more convenient to make enclosed mass the independent variable. Inverting (1) does exactly this and produces the Lagrangian form.
where: — now the independent coordinate, labelling each mass shell; — the radius of the shell that encloses mass . Every zone keeps a fixed mass label as the star expands or contracts, which is why evolution codes prefer it. All of the above are the static, spherical shadow of the general law of mass conservation in a moving fluid, which keeps the time-derivative and the full divergence of the mass flux .
where: — mass-density field; — fluid velocity field; — time. The stellar equation is the case , with spherical symmetry. A single number falls out of (2) immediately: divide the total mass by the total volume and you get the mean density, the crudest but most useful one-number summary of how tightly a star is packed.
where: — volume-averaged density; — total mass; — stellar radius. Real stars are far denser at the centre than , so this is a floor on the central density, not an estimate of it. Finally, feeding into hydrostatic equilibrium and changing variable with (3) yields the mass-coordinate momentum equation — the companion structure equation, shown here to make the coupling explicit.
where: — pressure; — Newton's gravitational constant; — enclosed mass, supplied by mass continuity. Without equation (1) there is no to place in the numerator, so (6) cannot even be written down on its own.
The goal is to obtain the differential equation directly from the physical statement that the mass added between and is the density there times the volume of the shell, and to show that this is exactly the Fundamental Theorem of Calculus applied to the enclosed-mass integral, so that differentiating and integrating are inverse operations here as everywhere else. We assume spherical symmetry throughout, so density depends only on radius, , and there is no angular dependence to integrate over.
Step 1. Define enclosed mass as the volume integral of density over the ball of radius : , where the factor is the area of the sphere at radius and its thickness. Why: spherical symmetry lets the three-dimensional volume integral collapse to a single radial integral over spherical shells, each of volume .
Step 2. Add one more shell of thickness at radius . To first order in the extra mass is ; the neglected terms are of order (the shell's own curvature and the density's variation across it) and vanish in the limit. Why: over an infinitesimally thin shell the density is effectively constant and the shell's volume is area times thickness, so its mass is just .
Step 3. Divide by and take the limit: . This is the derivative of the integral in Step 1 — the integrand evaluated at the upper limit. Why: differentiating an accumulated quantity returns the local rate of accumulation, which is the whole meaning of the continuity equation as a conservation law. *Verified: differentiating returns the integrand exactly, and the boundary values , are recovered.*
Go deeper · Derivation B · 1 minThe uniform sphere and the mean density
The goal is to work the enclosed-mass integral all the way through for the one profile that makes it trivial — constant density — and in doing so to derive both the cubic growth law and the mean-density formula , then check the result against the Sun. This uniform model is crude (real stars are strongly centre-heavy) but it fixes the density scale of a star and is the springboard for every order-of-magnitude estimate of interior conditions. We set , a constant, everywhere inside the star.
Step 1. Integrate continuity with pulled outside: . Why: with density constant the integral is elementary, and the result is just density times the volume of the ball — enclosed mass grows as the cube of the radius.
Step 2. Evaluate at the surface to get the total mass: . Why: the total mass is the enclosed mass at the outermost radius , which closes the model.
Step 3. Solve for the density: . For a genuinely uniform star equals the mean density; for a real star this same expression defines as the total mass spread over the total volume. Why: it converts two of a star's most directly measured properties — mass and radius — into a density, without any knowledge of the interior profile. *Verified: for the Sun, and give , the standard mean solar density (about 1.4 times water).*
Go deeper · Derivation C · 1 minPassing to the Lagrangian mass coordinate
The goal is to change the independent variable from radius to enclosed mass , showing that inverting the one-line continuity equation converts every structure equation to mass-coordinate form and, in the case of hydrostatic balance, makes the density cancel to leave the clean expression used in stellar-evolution codes. The pay-off is numerical: the mass domain is essentially fixed over a star's life, whereas its radius can change by orders of magnitude, so a mass grid keeps every computational zone tied to a definite parcel of matter. We start from the Eulerian continuity equation (1) and the radius-form hydrostatic equation.
Step 1. Invert continuity directly: , valid wherever , i.e. everywhere inside the star. Why: making mass the independent variable requires the reciprocal derivative, and continuity is exactly the relation between the two, so no new physics is introduced.
Step 2. Apply the chain rule to hydrostatic equilibrium : . Why: the chain rule threads the continuity factor into every radius-form equation, which is all that "changing variable to " means.
Step 3. Cancel the density: . The from hydrostatic balance and the from continuity divide out exactly, leaving a form that depends on and but not explicitly on . Why: the cancellation is algebraically exact and is precisely why the Lagrangian formulation is numerically well-behaved — the density, the most rapidly varying quantity, disappears from the momentum equation. *Verified: density cancellation is exact; the result matches the standard Lagrangian stellar-structure system (Kippenhahn, Weigert & Weiss, Ch. 9), and reduces to equation (6) above.*
Limiting cases
Special density profiles turn the enclosed-mass integral into something you can read off by eye, and each one teaches a different lesson about how mass concentrates.
| Case | Result | Meaning |
|---|---|---|
| Uniform density | Constant ; enclosed mass grows as . Crude but sets the density scale — the source of . | |
| Power law | For the central mass is finite; for it diverges, signalling an unphysical singular core. | |
| Isothermal-sphere tail | The case: enclosed mass grows linearly. Models molecular-cloud cores and flat-rotation-curve dark-matter halos. | |
| Point mass | for all | All mass at the origin gives a Keplerian exterior; is a delta function and continuity is vacuous outside. |
| Boundary conditions | The two anchors that pin the integration of the full structure equations. |
Worked examples
1 · Mean density of the Sun (confidence builder)
Estimate the Sun's mean density from its mass and radius, and say what it does and does not tell you about the core.
Step 1. Use equation (5). With and , first the volume: .
Step 2. Divide: , about 1.4 times the density of water.
Step 3. Interpret it. This is a volume average, and equation (2) makes clear it is dominated by the outer envelope where most of the volume is. The Sun's actual central density is roughly — some 100 times the mean — because the star is strongly centrally condensed. So is a firm lower bound on the central density and a good scale-setter, but never a substitute for solving the structure equations. The Sun's mean density is 1.41×10³ kg m⁻³, roughly one-hundredth of its central value.
2 · A centre-heavy linear model (fully worked)
Take a toy star whose density falls linearly to zero at the surface, , with the central density. Find , the total mass, and the ratio of central to mean density. Then evaluate for the Sun.
Step 1. Integrate continuity (equation 2): . Factoring, , which in fractional form is — the blue curve in the second figure.
Step 2. Total mass at the surface : .
Step 3. Compare with the mean density from equation (5): . So — this model concentrates the centre to four times the mean, a genuine improvement on the uniform sphere but still far short of reality.
Step 4. Put in numbers for the Sun. With from Example 1, the model predicts . The true solar central density is about , so even a centre-heavy linear law underestimates the real concentration by a factor of . The lesson: the Sun is far more centrally condensed than any simple polynomial density law — its core is dense because a realistic equation of state and the steep run of pressure demand it.
3 · Enclosed mass of a singular isothermal sphere
A dark-matter halo (or a self-gravitating gas cloud) has . How does the enclosed mass run with radius?
Step 1. Integrate: . The in the shell volume cancels the in the density, leaving a constant integrand.
Step 2. So : enclosed mass grows linearly, without limit as (the profile must be truncated at a finite radius). A test particle orbiting at radius then feels — a flat rotation curve, which is exactly why this profile is the textbook first model for the dark matter inferred around spiral galaxies.
Physics of the portrait
The mass continuity equation of a star is one static, spherical instance of a law older than astrophysics itself: the conservation of mass in a moving fluid, first written in the form we still use by Leonhard Euler.
Origins · 1 minLeonhard Euler and how this was discovered
The continuity equation is the oldest of the conservation laws written in the differential language of fields, and it is Euler's. In his 1757 memoir Principes généraux du mouvement des fluides, Euler set out the equations of an ideal fluid — the momentum equations that bear his name, and alongside them the statement that mass is neither created nor destroyed as the fluid flows, . It was among the first partial differential equations of mathematical physics, and it encodes a deceptively simple idea: the rate at which density piles up at a point is minus the net rate at which mass streams away from it. Every later conservation law — of charge, of probability in quantum mechanics, of energy in a flowing medium — is cast in this same continuity form. When astrophysicists in the nineteenth and twentieth centuries built the first mathematical stars, they took Euler's equation, switched off the flow, and imposed spherical symmetry, and out fell . J. Homer Lane in 1870 and Robert Emden in 1907 turned such gas spheres into the polytrope models, Eddington assembled the coupled structure equations in the 1920s, and Chandrasekhar gave them their modern form — but the mass equation at their base is Euler's continuity law, seen in the mirror of a static, spherical star.
Going further
Texts. Carroll & Ostlie, An Introduction to Modern Astrophysics, 2nd ed., Ch. 10 (equations of stellar structure) · Kippenhahn, Weigert & Weiss, Stellar Structure and Evolution, 2nd ed., Ch. 9 (the Lagrangian formulation) · Binney & Tremaine, Galactic Dynamics, 2nd ed., Ch. 2 (potential theory and enclosed mass) · Dodelson, Modern Cosmology, 2nd ed. (the continuity equation and conservation laws) · Ryden, Introduction to Cosmology, 2nd ed. (continuity for the cosmic fluid).
Provenance. The mass equation and its role among the structure equations follow Carroll & Ostlie Ch. 10; the Lagrangian mass-coordinate formulation and the exact density cancellation in equation (6) follow Kippenhahn, Weigert & Weiss Ch. 9; the general continuity equation is Euler's, as recorded in Binney & Tremaine, Dodelson, and Ryden. A verifier should confirm: (1) differentiating returns ; (2) the uniform sphere and ; (3) the mean solar density from , ; (4) the linear-model results and ; (5) ; (6) density cancellation giving .
Prerequisites. Density and spherical geometry · Newton's shell theorem. Leads to. Hydrostatic Equilibrium in Stars · Equations of Stellar Structure · Energy Generation Equation · Virial Theorem for Stars.
Ask the tutor: Want to see how mass continuity and hydrostatic equilibrium lock together to predict a star's central pressure — or how a MESA model marches this equation on a mass grid? Ask and we'll work it through.
Why is the surface area factor 4πr² and not something else?
Because a sphere of radius has surface area , and a thin shell at that radius is essentially that surface swept through a small thickness . Its volume is therefore area times thickness, , and its mass is that volume times the local density. The is the geometric heart of the equation: it says a shell far from the centre, though the same thickness as a shell near the centre, encloses vastly more volume and so — at equal density — vastly more mass. This is exactly why most of a star's volume lives in its outer layers even when most of its mass is deep inside.
What is the difference between the Eulerian and Lagrangian forms?
They are the same physics seen through two choices of independent variable. The Eulerian form asks "how does enclosed mass change as I step outward in radius?" — natural if you are standing at a fixed point in space. The Lagrangian form asks "how does radius change as I step outward through successive shells of mass?" — natural if you follow a fixed parcel of gas. For a static star either works; for an evolving star the Lagrangian view wins, because the parcels of matter persist while the radius they sit at drifts, and computing on a fixed mass grid conserves mass automatically.
Does the mean density formula tell me the density at the centre?
No — and treating it as if it did is a classic error. The mean density is the total mass divided by the total volume, a single average dominated by the roomy outer envelope. Real stars are strongly centrally condensed: the Sun's central density is about , roughly a hundred times its mean of . So is best read as a firm lower bound on the central density and a convenient scale-setter for order-of-magnitude estimates. The actual central value comes only from integrating the full set of structure equations with a proper equation of state.
When does the static equation fail, and what replaces it?
It fails whenever the gas is genuinely moving — a collapsing protostellar cloud, a pulsating Cepheid, a supernova, an accreting envelope. In all these cases the velocity field is not zero and the density at a point changes with time, so you must keep the full law . The static stellar form is the approximation valid when the star changes slowly compared with its dynamical (free-fall) time — true for nearly all of a star's main-sequence and giant life, but emphatically not during dynamical events. The rule of thumb: if the timescale you care about is longer than the sound-crossing or free-fall time, the static equation is safe.
How is this equation actually one of "four" equations of stellar structure?
The four are mass continuity (), hydrostatic equilibrium (), energy generation (), and energy transport ( by radiation or convection). Mass continuity is the one that supplies , which appears in the gravity term of hydrostatic balance — so the first two are inextricably coupled. Add an equation of state relating , and , plus opacity and nuclear-reaction physics, and four boundary conditions ( and at the centre, and a temperature condition at the surface), and the system determines the star's entire interior structure uniquely.
Why does the density cancel in the mass-coordinate hydrostatic equation?
Because enters twice with opposite roles. Hydrostatic balance in radius form carries a factor of in its gravity term (), and the change of variable from to brings in , which carries in its denominator. Multiplying them, the two densities divide out exactly, leaving with no explicit . This is more than an algebraic curiosity: the density is the fastest-varying quantity in a star, spanning many orders of magnitude, so removing it from the momentum equation is a large part of why the Lagrangian formulation is so numerically well-behaved.