Chain rule

1. Apr 27, 2015

whatisreality

1. The problem statement, all variables and given/known data
Let φ=φ(r) and r=√x2+y2+z2. Find ∂2φ/∂x2.
Show that it can be written as (1/r + x2/r3)∂φ/∂r + x2/r22φ/∂r2.
2. Relevant equations
Use the identity ∂r/∂x = x/r.

3. The attempt at a solution
I think I know ∂φ/∂x. Using the chain rule, it's ∂r/∂x ∂φ/∂r. That gives x/r ∂φ/∂r. If that's wrong it might be because I know you have to take account of all dependences, but I don't actually know how to.
So assuming that's ok, I then need to use the product rule, and that gave me
1/r ∂φ/∂r + ∂φ/∂x ∂φ/∂r ∂r/∂x.
Which I know is wrong, because it's a show that question!

2. Apr 27, 2015

Staff: Mentor

I would write this as dφ/dr ∂r/∂x or φ'(r)∂r/∂x = dφ/dr (x/r). φ is a function of r alone, so the derivative for this function is the regular derivative instead of the partial derivative. Now use the product rule to get ∂2φ/∂x2.

3. Apr 29, 2015

whatisreality

I'm doing something wrong. So I got ∂2φ/∂x2 = 1/r ∂φ/∂r + ∂/dr (dφ/dr) ∂r/∂x x/r. This doesn't give me the answer, it gives
2φ/∂x2 = 1/r dφ/dr + x2/r22φ/∂r2, but I really can't see what's wrong!

4. Apr 29, 2015

whatisreality

I'm missing a whole term: x2/r3 dφ/dr.

5. Apr 29, 2015

Staff: Mentor

You don't show the work leading up to this, but I'm guessing that you did this: $\frac{\partial}{\partial x} \frac{x}{r} = \frac{1}{r}$. If so, that's wrong, since you would be treating r as a constant. In fact, r is a function of x (and y and z).

6. Apr 29, 2015

whatisreality

Ohhh... That's exactly what I did. I always forget that!

7. Apr 29, 2015

whatisreality

Should be y2+z2/r3 then.
Yep, that gives the right answer! Thank you, I was getting really confused.