<p><span class="math-container">$$\frac{dP}{dr} = - \rho g,$$</span>
is the equation of hydrostatic equilibrium, where <span class="math-container">$\rho$</span> and <span class="math-container">$g$</span> are the local density and gravity, <span class="math-container">$P$</span> is pressure and <span class="math-container">$r$</span> is the radial coordinate. This can be rewritten as
<span class="math-container">$$\frac{d\rho}{dr} \frac{dP}{d\rho} = -\rho g.$$</span></p>
<p>Since <span class="math-container">$\rho$</span> and <span class="math-container">$g$</span> are positive numbers, the pressure gradient is negative.</p>
<p>For all types of matter <span class="math-container">$P = f(\rho)$</span>, such that <span class="math-container">$dP/d\rho$</span> is also positive (i.e. pressure increases with density).</p>
<p>Thus <span class="math-container">$d\rho/dr$</span> is negative and the density increases towards the middle.</p>
<p>Note that you ask about real stars, where the energy transport is by radiation or convection and the equation of state is that of an ideal, perfect gas. Two well-known results are that <span class="math-container">$P \propto \rho^{4/3}$</span> in radiative zones and <span class="math-container">$P\propto \rho^{5/3}$</span> in convection zones. So in both cases, pressure increases with density, regardless of what is happening with the temperature.</p>
<p>If instead we consider degenerate stars (either electrons or neutrons), then they tend to be isothermal, because of excellent thermal conductivity. But still <span class="math-container">$P \propto \rho^{\alpha}$</span> with <span class="math-container">$4/3 &lt; \alpha &lt; 5/3$</span> and <span class="math-container">$dP/d\rho$</span> is positive.</p>
<p>So it is impossible to construct a star with a density inversion using standard stellar equations of state and heat transport mechanisms.</p>
<p>EDIT: It might be possible to invent an equation of state that could result in a density inversion, requiring <span class="math-container">$dP/d\rho&lt;0$</span>. For example you might consider a situation where a sufficiently negative temperature gradient might counterbalance a positive density gradient.
i.e. if <span class="math-container">$P = f(\rho, T)$</span> then
<span class="math-container">$$ \frac{dP}{d\rho} = \frac{\partial P}{\partial \rho} + \frac{\partial P}{\partial T} \frac{dT}{d\rho}$$</span><br />
and <span class="math-container">$dP/d\rho&lt;0$</span> if
<span class="math-container">$$ \frac{dT}{d\rho} &lt; -\frac{\partial P/\partial \rho}{\partial P/\partial T}$$</span></p>

CC BY-SA 4.0
2020-08-17T10:10:29.877Z
Sorry, but asserting $P = f(\rho)$ for “all types of matter” is just bogus. Case in point, you may have water in your cup at atmospheric pressure with $\rho \approx 1000\:\mathrm{\frac{kg}{m^3}}$. But put that water in an enclosed steam kettle and bring to the boiling point, pressure will increase drastically without $\rho$ increase – on the contrary it _decreases_. $P = f(\rho,T)$ is closer to being true. So your argument would only hold true if $T$ were constant or increasing with radius, which is not at all true either.
leftaroundabout
CC BY-SA 4.0
2020-08-17T10:15:04.867Z
The real problem with radially-increasing $\rho$ is that absent sufficient viscosity, it immediately spurs convection which reduces the temperature gradient until density is radially-decreasing.
leftaroundabout
CC BY-SA 4.0
2020-08-17T10:15:50.527Z
@leftaroundabout It is not bogus to claim that P is a function of density. It is obviously not ONLY a function of density (an ideal gas being a case in point). However, I see your point and will think about it. In real stars convection zones have $P\propto \rho^{5/3}$ and radiative zone have $P \propto \rho^{4/3}$ independent of any consideration of the temperature.
ProfRob
CC BY-SA 4.0
2020-08-16T22:16:48.793Z
2021-09-26T17:04:49.733Z
2021-09-26T17:04:49.733Z
ProfRob
<p>Not as a steady state, for sure. If there happen to be a part less dense than its surroundings it would just float to the surface.</p>
<p>This is called <a href="https://en.wikipedia.org/wiki/Buoyancy" rel="noreferrer">buoyancy</a> and the math is basic enough.</p>
<p>Stars don't have solid parts and cannot sustain a state different from the hydrostatic near-equilibrium.</p>
<p>Then again, some transient event like supernova Ia explosion may create inverse density distribution with a void in the center, but I am not sure it is a legitimate star anymore at this point (AFAIR Ia explosions leave no dense remnant).</p>

CC BY-SA 4.0
2020-08-17T10:30:05.000Z
Apart from “solid parts” or viscosity, magnetohydrodynamic forces can also stabilise a non-hydrostatic density configuration. I think this doesn't happen in stars themselves, but it does happen in space plasma all around.
leftaroundabout
CC BY-SA 4.0
2020-08-17T10:40:44.793Z
@leftaroundabout I think you should write an answer. Your comments are quite valid and you might be able to put something together more comprehensive and succinct. I have paused at present (too busy) before reproducing a whole load of stuff about stability against convection.
ProfRob
CC BY-SA 4.0
2020-08-17T10:41:51.443Z
@leftaroundabout affect yes, stabilise no because these phenomena are dynamic in nature. Sun spots are non-hydrostatic, yes (the whole convection is not hydrostatic by definition, but the spots are even less so). Now that I am thinking about it, there are stars that have convection in their cores so they do have some density variation  there. Then again, the convection is extremely efficient mechanism for heat exchange and the goal put in the OP (density less than the average) is unthinkably high.
fraxinus
CC BY-SA 4.0
2020-08-18T11:31:12.780Z
Not to say that it is, but in principle considering different composition of layers one can imagine a lot of combination in which equilibrium exists so that a heavy layer is "floating" above an ignited and active core. No to say it happens, again I want to be clear on this. Pure gymnastics.
Alchimista
CC BY-SA 4.0
2020-08-18T13:00:26.523Z
@Alchimista that's how the convection happens. But the density variation is tiny and limited by the adiabatic gradient (or slightly off, depending on the convection efficiency). Then again, our lovely Sun's average density is ~1.4 and in the core it is 100+. The Sun doesn't have a core convection, but other main-sequence stars that do have one can't be extremely different. You need quite a deal of disturbance in order to create a less than 1.4 bubble in a 100+ density core. That's what the supernova events are for (and they happen in even denser star cores).
fraxinus
CC BY-SA 4.0
2020-08-17T07:23:46.360Z
2020-08-17T10:43:38.123Z
2020-08-17T10:43:38.123Z
fraxinus
<p>A density increasing with distance from the center is impossible for a star in hydrostatic equlibrium, regardless of the temperature profile (assuming the ideal gas law holds). In fact, the density has to decrease faster than <span class="math-container">$1/r$</span>, and it has to decrease 2 powers faster than the temperature (e.g. for an isothermal star it would have to decrease like <span class="math-container">$1/r^2$</span>). This is straightforward to prove from the equation of hydrostatic equilibrium for a self-gravitating gas sphere. Equating the pressure force on an atom with mass <span class="math-container">$m$</span></p>
<p><span class="math-container">$$\frac{1}{n(R)}\frac{dP(R)}{dR}= -\frac{Gm}{R^2}\int_0^R n(r) 4\pi r^2 dr$$</span></p>
<p>where <span class="math-container">$n$</span> is the number density , <span class="math-container">$P$</span> the pressure and <span class="math-container">$G$</span> the gravitational constant.</p>
<p>For an ideal gas we have</p>
<p><span class="math-container">$$P(R)=n(R)\cdot k\cdot T(R)$$</span></p>
<p>with <span class="math-container">$T$</span> the temperature and <span class="math-container">$k$</span> the Boltzmann constant.</p>
<p>Inserting this into the first equation gives</p>
<p><span class="math-container">$$\frac{k}{n(R)}\cdot [T(R)\frac{dn(R)}{dR}+n(R)\frac{dT(R)}{dR}] =-\frac{Gm}{R^2}\int_0^R n(r) 4\pi r^2 dr$$</span></p>
<p>If we now represent the radial dependence of the density and temperature by power laws in the form</p>
<p><span class="math-container">$$n(r)=n(R_0)\cdot \left(\frac{r}{R_0}\right)^p$$</span></p>
<p><span class="math-container">$$T(R)=T(R_0)\cdot \left(\frac{R}{R_0}\right)^q$$</span></p>
<p>we get the following equation</p>
<p><span class="math-container">$$k \frac{T(R_0)}{R_0^q}\cdot (p+q)(3+p)\cdot R^{q-1} = -\frac{4\pi Gm\cdot n(R_0)}{R_0^p}\cdot R^{p+1}$$</span></p>
<p>We see the following from this: since the <span class="math-container">$R$</span> dependence on the left and right hand side must be identical, we must have</p>
<p><span class="math-container">$$q-1=p+1$$</span>
that is
<span class="math-container">$$q=p+2$$</span></p>
<p>Also, since the right hand side is always negative, the left hand side must be as well, which means we must have</p>
<p><span class="math-container">$$(p+q)(3+p) = 2(p+1)(3+p) &lt;0$$</span>
i.e.
<span class="math-container">$$-3&lt;p&lt;-1$$</span></p>
<p>In other words, the number density must decrease faster than <span class="math-container">$1/R$</span> but slower than <span class="math-container">$1/R^3$</span>. And it must decrease two powers faster than the temperature (<span class="math-container">$p=q-2$</span>). Otherwise the star could not be stable.</p>
<p>We also see from this that the temperature <em>could</em> in principle increase from the center outwards (i.e. q&gt;0) (ignoring the question how this could be achieved in practice), but it must increase more slowly than linear (q&lt;1), so the pressure (density times temperature) still decreases going outwards.</p>

CC BY-SA 4.0
2021-09-26T16:42:22.983Z
You can't just assume the perfect gas law (though your analysis is probably ok for that case).
ProfRob
CC BY-SA 4.0
2021-09-26T17:17:53.710Z
@ProfRob You implicated yourself the ideal gas law in your own answer by implicating a negative temperature gradient could counterbalance a positive density gradient. As my basic analysis shows, this is not possible. If you want to consider deviations from the ideal gas law (which still would need to be justified) you just have to multiply some additional factors to the power indices p and q above. In any case, the OP wanted a clear mathematical justification for the answer, which I think I have given here. Anything more would imply some degree of speculation.
Thomas
CC BY-SA 4.0
2021-09-26T17:46:34.753Z
White dwarfs are not governed by the perfect gas law.
ProfRob
CC BY-SA 4.0
2021-09-26T16:18:35.700Z
2021-09-29T18:46:44.850Z
2021-09-29T18:46:44.850Z
Thomas
<p>Are there likely to be stars for which the average density is greater than the density at the centre? Intuitively, I would say not, as density tends to decrease outwards, but ideally I would appreciate a clear mathematical justification for this.</p>

CC BY-SA 4.0
2020-08-16T22:12:43.403Z
Not an answer, but this may be helpful; look for *Hydrostatic Equilibrium* in [Equations of Stellar Structure](https://en.wikipedia.org/wiki/Stellar_structure#Equations_of_stellar_structure) and in [How Stars Work](https://www.astro.caltech.edu/~george/ay20/Ay20-Lec7x.pdf)
uhoh
CC BY-SA 4.0
2021-09-24T10:52:14.437Z
How would the average of anything be larger than the maximum value over which it is averaged? What am I missing here?
AtmosphericPrisonEscape
CC BY-SA 4.0
2021-09-24T13:50:13.957Z
@AtmosphericPrisonEscape The question is about the *central* density, which could in principle be zero (e.g. for a hollow object). Of course, no *star* is going to be like that…
Peter Erwin
CC BY-SA 4.0
2021-09-24T14:42:39.170Z
@PeterErwin: Ah yes, if you assume that the maximum can be somewhere else than in the center, the question make sense.
AtmosphericPrisonEscape
<star><stellar-evolution><stellar-astrophysics>
Are there stars with an average density greater than the central density?
wrb98
# Are there stars with an average density greater than the central density?

(Asked by: username_0 on 2020-08-16)

Are there likely to be stars for which the average density is greater than the density at the centre? Intuitively, I would say not, as density tends to decrease outwards, but ideally I would appreciate a clear mathematical justification for this.

**Tags:** star, stellar-evolution, stellar-astrophysics

> **Comments:**
> **username_1**: Not an answer, but this may be helpful; look for *Hydrostatic Equilibrium* in [Equations of Stellar Structure](https://en.wikipedia.org/wiki/Stellar_structure#Equations_of_stellar_structure) and in [How Stars Work](https://www.astro.caltech.edu/~george/ay20/Ay20-Lec7x.pdf)  
> **username_2**: How would the average of anything be larger than the maximum value over which it is averaged? What am I missing here?  
> **username_3**: @username_2 The question is about the *central* density, which could in principle be zero (e.g. for a hollow object). Of course, no *star* is going to be like that…  
> **username_2**: @username_3: Ah yes, if you assume that the maximum can be somewhere else than in the center, the question make sense.  

---

## 3 answers

### Answer by username_4 on 2020-08-16. Score: 12

$$\frac{dP}{dr} = - \rho g,$$
is the equation of hydrostatic equilibrium, where $\rho$ and $g$ are the local density and gravity, $P$ is pressure and $r$ is the radial coordinate. This can be rewritten as
$$\frac{d\rho}{dr} \frac{dP}{d\rho} = -\rho g.$$

Since $\rho$ and $g$ are positive numbers, the pressure gradient is negative.

For all types of matter $P = f(\rho)$, such that $dP/d\rho$ is also positive (i.e. pressure increases with density).

Thus $d\rho/dr$ is negative and the density increases towards the middle.

Note that you ask about real stars, where the energy transport is by radiation or convection and the equation of state is that of an ideal, perfect gas. Two well-known results are that $P \propto \rho^{4/3}$ in radiative zones and $P\propto \rho^{5/3}$ in convection zones. So in both cases, pressure increases with density, regardless of what is happening with the temperature.

If instead we consider degenerate stars (either electrons or neutrons), then they tend to be isothermal, because of excellent thermal conductivity. But still $P \propto \rho^{\alpha}$ with $4/3 < \alpha < 5/3$ and $dP/d\rho$ is positive.

So it is impossible to construct a star with a density inversion using standard stellar equations of state and heat transport mechanisms.

EDIT: It might be possible to invent an equation of state that could result in a density inversion, requiring $dP/d\rho<0$. For example you might consider a situation where a sufficiently negative temperature gradient might counterbalance a positive density gradient.
i.e. if $P = f(\rho, T)$ then
$$ \frac{dP}{d\rho} = \frac{\partial P}{\partial \rho} + \frac{\partial P}{\partial T} \frac{dT}{d\rho}$$  
and $dP/d\rho<0$ if
$$ \frac{dT}{d\rho} < -\frac{\partial P/\partial \rho}{\partial P/\partial T}$$

> **Comments:**
> **username_5**: Sorry, but asserting $P = f(\rho)$ for “all types of matter” is just bogus. Case in point, you may have water in your cup at atmospheric pressure with $\rho \approx 1000\:\mathrm{\frac{kg}{m^3}}$. But put that water in an enclosed steam kettle and bring to the boiling point, pressure will increase drastically without $\rho$ increase – on the contrary it _decreases_. $P = f(\rho,T)$ is closer to being true. So your argument would only hold true if $T$ were constant or increasing with radius, which is not at all true either.  
> **username_5**: The real problem with radially-increasing $\rho$ is that absent sufficient viscosity, it immediately spurs convection which reduces the temperature gradient until density is radially-decreasing.  
> **username_4**: @username_5 It is not bogus to claim that P is a function of density. It is obviously not ONLY a function of density (an ideal gas being a case in point). However, I see your point and will think about it. In real stars convection zones have $P\propto \rho^{5/3}$ and radiative zone have $P \propto \rho^{4/3}$ independent of any consideration of the temperature.  

---

### Answer by username_6 on 2020-08-17. Score: 6

Not as a steady state, for sure. If there happen to be a part less dense than its surroundings it would just float to the surface.

This is called [buoyancy](https://en.wikipedia.org/wiki/Buoyancy) and the math is basic enough.

Stars don't have solid parts and cannot sustain a state different from the hydrostatic near-equilibrium.

Then again, some transient event like supernova Ia explosion may create inverse density distribution with a void in the center, but I am not sure it is a legitimate star anymore at this point (AFAIR Ia explosions leave no dense remnant).

> **Comments:**
> **username_5**: Apart from “solid parts” or viscosity, magnetohydrodynamic forces can also stabilise a non-hydrostatic density configuration. I think this doesn't happen in stars themselves, but it does happen in space plasma all around.  
> **username_4**: @username_5 I think you should write an answer. Your comments are quite valid and you might be able to put something together more comprehensive and succinct. I have paused at present (too busy) before reproducing a whole load of stuff about stability against convection.  
> **username_6**: @username_5 affect yes, stabilise no because these phenomena are dynamic in nature. Sun spots are non-hydrostatic, yes (the whole convection is not hydrostatic by definition, but the spots are even less so). Now that I am thinking about it, there are stars that have convection in their cores so they do have some density variation  there. Then again, the convection is extremely efficient mechanism for heat exchange and the goal put in the OP (density less than the average) is unthinkably high.  
> **username_7**: Not to say that it is, but in principle considering different composition of layers one can imagine a lot of combination in which equilibrium exists so that a heavy layer is "floating" above an ignited and active core. No to say it happens, again I want to be clear on this. Pure gymnastics.  
> **username_6**: @username_7 that's how the convection happens. But the density variation is tiny and limited by the adiabatic gradient (or slightly off, depending on the convection efficiency). Then again, our lovely Sun's average density is ~1.4 and in the core it is 100+. The Sun doesn't have a core convection, but other main-sequence stars that do have one can't be extremely different. You need quite a deal of disturbance in order to create a less than 1.4 bubble in a 100+ density core. That's what the supernova events are for (and they happen in even denser star cores).  

---

### Answer by username_8 on 2021-09-26. Score: 2

A density increasing with distance from the center is impossible for a star in hydrostatic equlibrium, regardless of the temperature profile (assuming the ideal gas law holds). In fact, the density has to decrease faster than $1/r$, and it has to decrease 2 powers faster than the temperature (e.g. for an isothermal star it would have to decrease like $1/r^2$). This is straightforward to prove from the equation of hydrostatic equilibrium for a self-gravitating gas sphere. Equating the pressure force on an atom with mass $m$

$$\frac{1}{n(R)}\frac{dP(R)}{dR}= -\frac{Gm}{R^2}\int\_0^R n(r) 4\pi r^2 dr$$

where $n$ is the number density , $P$ the pressure and $G$ the gravitational constant.

For an ideal gas we have

$$P(R)=n(R)\cdot k\cdot T(R)$$

with $T$ the temperature and $k$ the Boltzmann constant.

Inserting this into the first equation gives

$$\frac{k}{n(R)}\cdot [T(R)\frac{dn(R)}{dR}+n(R)\frac{dT(R)}{dR}] =-\frac{Gm}{R^2}\int\_0^R n(r) 4\pi r^2 dr$$

If we now represent the radial dependence of the density and temperature by power laws in the form

$$n(r)=n(R\_0)\cdot \left(\frac{r}{R\_0}\right)^p$$

$$T(R)=T(R\_0)\cdot \left(\frac{R}{R\_0}\right)^q$$

we get the following equation

$$k \frac{T(R\_0)}{R\_0^q}\cdot (p+q)(3+p)\cdot R^{q-1} = -\frac{4\pi Gm\cdot n(R\_0)}{R\_0^p}\cdot R^{p+1}$$

We see the following from this: since the $R$ dependence on the left and right hand side must be identical, we must have

$$q-1=p+1$$
that is
$$q=p+2$$

Also, since the right hand side is always negative, the left hand side must be as well, which means we must have

$$(p+q)(3+p) = 2(p+1)(3+p) <0$$
i.e.
$$-3<p<-1$$

In other words, the number density must decrease faster than $1/R$ but slower than $1/R^3$. And it must decrease two powers faster than the temperature ($p=q-2$). Otherwise the star could not be stable.

We also see from this that the temperature *could* in principle increase from the center outwards (i.e. q>0) (ignoring the question how this could be achieved in practice), but it must increase more slowly than linear (q<1), so the pressure (density times temperature) still decreases going outwards.

> **Comments:**
> **username_4**: You can't just assume the perfect gas law (though your analysis is probably ok for that case).  
> **username_8**: @username_4 You implicated yourself the ideal gas law in your own answer by implicating a negative temperature gradient could counterbalance a positive density gradient. As my basic analysis shows, this is not possible. If you want to consider deviations from the ideal gas law (which still would need to be justified) you just have to multiply some additional factors to the power indices p and q above. In any case, the OP wanted a clear mathematical justification for the answer, which I think I have given here. Anything more would imply some degree of speculation.  
> **username_4**: White dwarfs are not governed by the perfect gas law.  

---

