We know that for polar $(r,\theta)$ and Cartesian $(x,y)$ coordinates:
$r=\sqrt{x^2+y^2}$ (1)
$x=r\cos\theta$ (2)
I am trying to find $\dfrac{\partial r}{\partial x}$. I have tried two methods, which do not give the same answer, and I want to know where I've gone wrong.
Method 1:
Use equation (1) to get
$$\frac{\partial r}{\partial x}=\frac{x}{\sqrt{x^2+y^2}}=\frac{r\cos\theta}{r}=\cos\theta$$
Method 2:
Use equation (2) to write
$$r=\frac{x}{\cos\theta}$$ so $$\frac{\partial r}{\partial x}=\frac{1}{\cos\theta}$$
I think that it's Method 1 that's correct, but I can't see what the mistake is that I've made in Method 2. I'm sure it's blindingly obvious, but any advice would be highly appreciated.