# Homework Help: Density of a star

1. Jan 17, 2010

### beavez

1. The problem statement, all variables and given/known data
For a star of mass M and radius R, the density increases from the centre to the surface as a function of radial distance r, according to

$$\rho = \rho_{c}[1-(\frac{r}{R})^2]$$

where is the central density constant.

a) Find M(r).
b) Derive the relation between M and R and show that the average density of the star is .

i know that D=M/V
so M = D.V ; i simply substiuted the Given Density and the volume by 4Pi/3r^3
but somethin is wrong!

2. Relevant equations

3. The attempt at a solution

2. Jan 17, 2010

### diazona

D=M/V only when the density is constant over the entire volume, or when you're trying to compute an average density. In this case, the density is not constant over the entire volume, so you can't just figure out M from M=D*V. You need to account for the fact that D is different in different parts of the volume. How can you do that? (Hint: calculus is required)

Also, I can't see some parts of your post. What is the average density supposed to be?

3. Jan 17, 2010

### beavez

right!! i have to integrate over dr... and i should take the volume of the shell . the thank you for your help : )

4. Jan 17, 2010

### jdwood983

For part a, you need the integral

$$m(r)=\int_0^r 4\pi r^2\rho(r)\,dr$$

Then the total mass in part b, $M$, comes from using $r=R$ in the result of part a.

This is from Dina Prialnik's Stellar Astrophysics textbook, right?