# Stellar structure integration

I have some issue regarding the stellar structure. I know analytically the equation of state, and I have been asked to build the structure of the star from these two equations

$$\frac{dP}{dr}=-\frac{G m \rho}{r^2}$$

$$\frac{dm}{dr}=4 \pi r^2 \rho$$

The problem is that I have been told to integrate over density, so I don't really know how to transform these equations in order to do that. Any help is welcome!

• Ae you sure you haven't been told to use mass as the integrating variable? Commented Apr 9, 2020 at 12:07
• Yes, I was explicitly told to use the density as the integration variable. Commented Apr 9, 2020 at 12:24
• What do you know about the equation of state? Is it polytropic? Commented Apr 9, 2020 at 12:35
• Not actually, it is an isothermal white dwarf with Sommerfeld corrections (arbitrary degeneracy) so it has to be integrated numerically. Commented Apr 9, 2020 at 12:42
• So if it is isothermal then you have P = f(rho). Commented Apr 9, 2020 at 12:52

If you have $$P = f(\rho)$$, then $$dP = f' d\rho$$.
The equations of stellar structure become $$\frac{dP}{d\rho} = f'$$ $$\frac{dm}{d\rho} = - \frac{4\pi r^4 f'}{Gm}$$
For a more general equation of state, $$P = f(T, \rho)$$, then you would also need an equation for $$dT/d\rho$$, which you would get from the equation for energy transfer, either radiative diffusion or convective transport. Note, that even in a white dwarf, this is required in the outer $$\sim 1$$% (by mass) of the star, where degeneracy and isothermality cannot be assumed, and it may significantly alter the derived radius at a given mass, depending on the mass (negligible at higher masses) and interior temperature (negligible if $$T< \sim 5\times 10^6$$ K).