Applying mass conservation to the mass d
integrating this gives us the total mass of the star 
It is often more convenient to describe stellar structure in a Lagrangian as opposed to Eulerian coordinate system - 
Applying this transformation,
allows us to rewrite our equation for mass conservation:
This brings us to our first stellar structure equation!
Next, we to describe the equation of motion for a gas element inside the star:
For a static star, no net acceleration, 
This is known as the equation of hydrostatic (or mechanical) equilibrium (HSE), we can also write in our Lagrangian formulation
Since 
This brings us to our second stellar structure equation!
connects two important energy reservoirs of a star and allows
predictions and interpretations phases in the evolution of stars.
Starting from HSE and multiplying by the volume and integrating:
reducing to
We can identify the right hand side (RHS) of the equation as the familiar gravitational potential energy of the star, the work performed by the gravitational force to bring all mass elements from infinity to their current radius:
The LHS requires integration by parts (im sorry): 
assuming the pressure at the surface is negligible 
We typically see it written in its final form as
or more commonly, using 
This is the general form of the virial theorem.
The LHS is (for an ideal gas!) related to the internal energy,
leading to the final relation
General form:
For an ideal monotomic gas:
We will explore and use different relevant estimated timescales for stellar evolution.
Dynamical timescale
timescale on which a star reacts to a perturbation of hydrostatic equilibrium
Q: What is the dynamical timescale of the sun?
Thermal or Kelvin-Helmholtz timescale
Nuclear timescale - Timescale that a star can remain in thermal equilibrium due to its nuclear burning and fuel supply
where, 
In class: Work on ICA here with partner, I will ask one or two people to share and describe plots at the end of class.
After Class: End of day today, September, 2, 2025
nbconvert to D2L, the progress you have made.ICAs are not always designged to be completed but rather worked on in class, submit what you have when you leave the class even if you did not make much progress.