# Derive the virial theorem from hydrostatic equikibrium

Consider the equation of hydrostatic equilibirium as follows as applied to a stellar object: $$\frac{dP}{dr } = \frac{-GM\rho}{r^2}$$

I know it is intimately related to the virial theorem but I am unsure how to derive the virial theorem from the above expression. I tried integrating as follows: $$\int_0 ^P dP = \int_0 ^R \frac{-Gm\rho}{r^2} dr$$

However I run into a problem as infinity gets in to the expression.

Ay help would be appreciated.

• Maybe you shouldn't use 0 as the lower limit since you are using a point mass for your force. – Ballanzor Feb 20 at 15:36
• Can you provide a source for your first equation, please? – PackSciences Feb 20 at 16:14
• I just uploaded the text from where I obtained it – David Abraham Feb 20 at 17:08
• Read on virial theorem here, home.strw.leidenuniv.nl/~nefs/BasicStellarPhysics.pdf , sec. 2.2 – Ján Lalinský Feb 20 at 17:52