# Just needs maths checking

1. Jan 17, 2009

### Brewer

1. The problem statement, all variables and given/known data
Under the assumption that the hot, X-ray emitting gas in the halo of an elliptical galazy is in hydrostatic equilibrium with the gravitational field of the galaxy, show that the total mass interior to radius r is given by:

$$M(r) = -\frac{kT(r)r}{\mu m_p G}(\frac{dln\rho_g(r)}{dlnr}+\frac{dlnT(r)}{dlnr})$$

Where $$\rho_g(r)$$ and $$T(r)$$ are the gas density and temperature.

2. Relevant equations
From my notes:
$$\frac{dP_g(r)}{dr} = -\frac{GM(r)\rho_g(r)}{r^2}$$

and

$$P_g(r) = N_g(r)kT(r) = \frac{\rho_g(r)}{\mu m_p}kT(r)$$

3. The attempt at a solution
I have done this question before I should add, so I know it works. It was part of a homework, but the work was never given back so I can't check it there. I'm just doing it now as part of my revision.

The way I was going to head about this question was to differentiate the second of the two equations with respect to r, and set them equal to each other. However when doing this I can't see how the final answer has logs in it, as I seem to be getting:
$$\frac{dP_g(r)}{dr} = \frac{k}{\mu m_p}(\rho_g(r)\frac{dT(r)}{dr} + T(r)\frac{d\rho_g(r)}{dr})$$

Have I gone wrong with my differentiating somewhere? Its been a long time since I've had any real practice this year, so I wouldn't be all that surprised.

I also think I have one too many factors of r as well, but the equation in the notes has $$r^2$$

Any hints would be appreciated. Thanks

2. Jan 17, 2009

### cristo

Staff Emeritus
You're going along the right lines. Now, you need to replace your derivatives in your expression for dP/dr with the derivatives involving logs in the solution.

For example, one can write $$\frac{d\ln T}{d \ln r}=\frac{d\ln T}{dr}\frac{dr}{d \ln r}$$, using the chain rule.

The second part on the RHS is just the reciprocal of d/dr{lnr}. You can then write the logarithmic derivative of T in terms of the derivative of T. Do the same for \rho, and you should have your answer. Post how you get on, and I'll be happy to give further comments.

3. Jan 17, 2009

### Brewer

I'm not really seeing what you mean. Can you expand on this a bit further please?

4. Jan 17, 2009

### cristo

Staff Emeritus
Well, $$\frac{d\ln T}{d \ln r}=\frac{d\ln T}{dr}\frac{dr}{d \ln r} = \frac{dT}{dr}\frac{d \ln T}{dT} \cdot r =\frac{dT}{dr}\frac{1}{T}\cdot r$$

Then, rearranging, gives $$\frac{dT}{dr}=\frac{T}{r}\frac{d \ln T}{d \ln r}$$, which you can then substitute into your expression for dP/dr.

Do this, and the same for rho, and you should obtain the expression in your first post.

5. Jan 17, 2009

### Brewer

Hmmm...

I think I see it now. Having looked up the rules for differentiating logs!