Hydrostatic Equilibrium

Consider a cylindrical region (length dr, end area dA) at a distance r from the center of the sun:
 

 
 

And the cylinder has properties
 

 
 
Now, what is the force of gravity acting on the cylinder?
 
 
 

Now, define the quantity

(what is g(r)?)
 

so that we have

 
 
 

What balances this gravitational force? Pressure. So let's calculate the pressure acting on the cylinder. (remember Pressure = Force/Area)
 

The cylinder feels the pressure from the stuff above it pushing down, plus the pressure from the stuff below pressing up. So the net pressure is
 

 

and the force associated with this pressure is

 

 
 

OK. These forces must balance for the sun to be in equilibrium:
 

 
 
A little algebra yields The Equation of Hydrostatic Equilibrium:
 
 
 
 
 The equation of hydrostatic equilbrium shows how the pressure in the sun changes to balance gravitational collapse. But what creates the pressure?
 
The Equation of State: P(rho,T)
For an ideal gas