Suppose $z = x^2+2y^2, $ and
$x=r\cos(\theta), y=r\sin(\theta)$
What is ($\frac{\partial z}{\partial \theta})_y =?$ This is the partial derivative of $z$ with respect to $\theta$, holding $y$ constant.
Here is my thought process. We need to transform $z$ to only use $\theta$ and $y$ without $x$.
So $z = x^2 +y^2 + y^2 = r^2+y^2$
We know $ y=r\sin(\theta)$, so $ y^2=r^2\sin^2(\theta)$. Then we can solve for $r^2$.
$r^2 = \frac{y^2}{\sin^2\theta}$
Finally, plug $r^2$ into $z$
$z = \frac{y^2}{\sin^2\theta} + y^2 = y^2(\frac{1}{\sin^2\theta}+1) $
At this point $z$ is in terms of only $\theta$ and $y$. We are ready to take ($\frac{\partial z}{\partial \theta})_y $.
($\frac{\partial z}{\partial \theta})_y = -2y^2 \cot(\theta) \csc^2(\theta)$.
However, this is the wrong answer. The solution is $-2r^2 \cot \theta$.
What am I doing wrong?