====== Plot Earth’s density profile ====== We can estimate how density varies inside the Earth by using seismic data, particularly the speeds of **P-waves** and **S-waves**. These waves travel through the Earth’s interior during earthquakes and carry information about its internal structure. ==== Seismic Wave Velocities ==== The velocities of seismic waves depend on the elastic properties and density of the material. * **P-wave (primary, compressional) speed:** $$ v_p^2 = \frac{K + \frac{4}{3} \mu}{\rho} $$ * **S-wave (secondary, shear) speed:** $$ v_s^2 = \frac{\mu}{\rho} $$ Here: * $K$ = bulk modulus (resistance to compression) * $\mu$ = shear modulus (resistance to shear) * $\rho$ = density By eliminating $\mu$, we can express the **bulk modulus per unit density** as: $$ \frac{K}{\rho} = v_p^2 - \frac{4}{3} v_s^2 $$ ==== Hydrostatic Equilibrium and Pressure Gradient ==== The pressure at a given depth in the Earth must balance the weight of overlying layers. The pressure difference between the top and bottom of a spherical shell is given by: $$ \frac{\Delta P}{\Delta r} \simeq -\frac{G \rho M(