# Homework Help: Chain Rule in 2 variables

1. Oct 7, 2012

### CAF123

1. The problem statement, all variables and given/known data
Given that $$f(x,y) = g(r,\theta),$$ where $x = r\cos\theta$ and $y = r\sin\theta,$ find formulae for $\frac{∂f}{∂x}$ and $\frac{∂f}{∂y}$ expressed entirely in terms of $r, \theta, \frac{∂g}{∂r} , \frac{∂g}{∂\theta}$.

3. The attempt at a solution
I said $$\frac{∂f}{∂x} = \frac{∂g}{∂x} = \frac{∂g}{∂r}\frac{∂r}{∂x} + \frac{∂g}{∂\theta}\frac{∂\theta}{∂x}.$$
Rearranging x = rcos(θ) to r = x/(cos(θ) gave $\frac{∂r}{∂x} = \sec\theta$ and $\frac{∂\theta}{∂x} = -\frac{1}{r\sin\theta}$
Can someone tell me if this is correct?
I used a similar method for $\frac{∂f}{∂y} = \frac{∂g}{∂y}$
Many thanks

2. Oct 7, 2012

### voko

You need to express r and theta in terms of x and y, and then find their derivatives.

3. Oct 7, 2012

### CAF123

I expressed r = x/cosθ, found $\frac{∂r}{∂x}$ and then r = y/sinθ and found $\frac{∂r}{∂y}$ Is this not correct?

4. Oct 7, 2012

### voko

In r = x/cosθ, θ is also a function of x. Ditto for r = y/sinθ. You need to express r and θ as explicit functions of x and y to obtain their derivatives. Or use the implicit function theorem if you have it.

5. Oct 7, 2012

### CAF123

I don't see how it is possible to write r as a function of x and y explicitly;
If r = x/cosθ and θ = arcsin(y/r) then r = x/cos(arcsin(y/r))

6. Oct 7, 2012

### voko

Consider x^2 + y^2.

7. Oct 7, 2012

### CAF123

Thanks. I got $\frac{∂r}{∂x} = \cosθ$ and $\frac{∂r}{∂y} = \sin\theta$
How do you obtain theta as a function of x and y?

8. Oct 7, 2012

### voko

Given x = rcosθ and y = rsinθ, surely you can exclude r and thus get θ as a function of x and y.

9. Oct 7, 2012

### CAF123

Yes, of course, sorry I have been looking at this problem for quite a while now and I think I am just overlooking simple things at times.
So, $\frac{∂θ}{∂x} = -\frac{\sin\theta}{r}$ and $\frac{∂θ}{∂y} = \frac{\cos\theta}{r}$
Bringing this all together: $$\frac{∂f}{∂x} = \frac{∂g}{∂r}(\cos\theta) + \frac{∂g}{∂\theta}(-\sin\theta/r)$$
And; $$\frac{∂f}{∂y} = \frac{∂g}{∂r}(\sin\theta) + \frac{∂g}{∂\theta}((\cos\theta)/r)$$
Ok now?
Just to check a couple of things: was the reason I was wrong first was because x is a function of theta but theta also depends on y? and similarly for r? Was my error in forgetting that theta also had a y dependence?

10. Oct 7, 2012

### voko

I think you should pause here for a second. $r$ and $\theta$ are known as polar coordinates; you have been given the representation of Cartesian coordinates in polar coordinates, and you have found (although not written here) the representation of polar coordinates in Cartesian coordinates. This all is worth committing to memory, you are going to encounter polar coordinates many, many times and you should know how to transform to and fro.

Looks good to me.

I would say this was because $\theta$ depends on x and y.

11. Oct 7, 2012

### CAF123

$$r = \sqrt{x^2+y^2}, \; \tan(\theta) = y/x.$$