Double partial derivative proof Let $z=f(x,y)$  where $x:=r \cos \theta$ and $y := r \sin \theta$.
I had to prove that $\frac {\partial ^{2}z}{\partial \ x^{2}} + \frac {\partial ^{2}z}{\partial \ x^{2}} = \frac {\partial ^{2}z}{\partial \ r^{2}} \ + \dots$ The whole equation was given.
My doubt:
I applied Jacobian and tried to solve this but I ended up in a loop where I was substituting the same things back and forth.
The solution provided said this.
$\frac {\partial ^{2}z}{\partial r^{2}} \ = \frac {\partial}{\partial r}(\frac {\partial z}{\partial r})  = \frac {\partial}{\partial r}(\cos \theta \frac {\partial z}{\partial x} + \sin \theta \frac {\partial z}{\partial y})$
$ = \cos \theta \ [ \cos \theta \frac {\partial}{\partial x} + \sin \theta \frac {\partial }{\partial y} ](\frac {\partial z}{\partial x}) \ + \sin \theta [ \cos \theta \frac {\partial }{\partial x} + \sin \theta \frac {\partial }{\partial y} ] (\frac {\partial z}{\partial y}).$
I do not understand the last step. What exactly is happening? Why do we use the partial derivative of $z$ with respect to $r$ (and skip the $z$ in the numerator) and multiply it with partial derivative of z with respect to $x$ and $y$? Since $x$ and $y$ are functions of $r$ and $\theta$ and since in $\frac {\partial z}{\partial x}$ we have kept $y$ constant are we accounting for that? I am really confused as this relevant theory wasn't taught in class and the professor hasn't been helpful to clear this part. Any insight is highly appreciated.
 A: It sounds like your question is really why
$$ \frac{\partial}{\partial r} = \cos(\theta) \frac{\partial}{\partial x} + \sin(\theta) \frac{\partial}{\partial y} $$
since this is what is being used in the last step.
The short answer: the chain rule
The long answer: $x$ and $y$ can be written as functions of $r$ and $\theta$, as you've written at the very top of your post. Then a function $f(x,y)$ can be thought of as $f\Big(x(r,\theta), \; y(r,\theta)\Big)$. Then the chain rule says that
$$ \frac{\partial f}{\partial r} = \frac{\partial f}{\partial x} \frac{\partial x}{\partial r} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial r} $$
You get the result by seeing that $\frac{\partial x}{\partial r} = \cos(\theta)$ and $\frac{\partial y}{\partial r} = \sin(\theta)$.
A: Here we look at first at the general situation and develop the second partial derivative by consequently applying the chain rule. This way we can better see  symmetries which is helpful when calculating the special case.
We consider the functions
\begin{align*}
z=f(x,y)\qquad\qquad x&=x(r,\theta)=r\cos\theta\\
y&=y(r,\theta)=r\sin\theta
\end{align*}
First partial derivative:$\quad\Large{\frac{\partial z}{\partial r}}$

We obtain by applying the chain rule
\begin{align*}
\frac{\partial z}{\partial r}=\frac{\partial z}{\partial x}\cdot\frac{\partial x}{\partial r}
+\frac{\partial z}{\partial y}\cdot \frac{\partial y}{\partial r}\tag{1}
\end{align*}

Second partial derivative:$\quad\Large{\frac{\partial^2 z}{\partial r^2}}$

We obtain by applying $\frac{\partial}{\partial r}$ to (1) using the chain rule again as well as the product rule of derivatives
\begin{align*}
\frac{\partial^2 z}{\partial r^2}
&=\frac{\partial }{\partial r}
\left(\frac{\partial z}{\partial x}\cdot\frac{\partial x}{\partial r}
+\frac{\partial z}{\partial y}\cdot \frac{\partial y}{\partial r}\right)\tag{2}\\
&=\frac{\partial }{\partial r}
\left(\frac{\partial z}{\partial x}\cdot\frac{\partial x}{\partial r}\right)
+\frac{\partial }{\partial r}\left(\frac{\partial z}{\partial y}\cdot \frac{\partial y}{\partial r}\right)\tag{3}\\
&=\color{red}{\frac{\partial }{\partial r}\left(\frac{\partial z}{\partial x}\right)}\cdot\frac{\partial x}{\partial r}
+\frac{\partial z}{\partial x}\cdot\frac{\partial }{\partial r}\left(\frac{\partial x}{\partial r}\right)\\
&\qquad+\color{blue}{\frac{\partial }{\partial r}\left(\frac{\partial z}{\partial y}\right)}\cdot\frac{\partial y}{\partial r}
+\frac{\partial z}{\partial y}\cdot\frac{\partial }{\partial r}\left(\frac{\partial y}{\partial r}\right)\tag{4}\\
&=\color{red}{\left(\frac{\partial^2 z}{\partial x^2}\cdot\frac{\partial x}{\partial r}
+\frac{\partial^2 z}{\partial y\partial x}\cdot \frac{\partial y}{\partial r}\right)}\cdot\frac{\partial x}{\partial r}
+\frac{\partial z}{\partial x}\cdot\frac{\partial^2 x}{\partial r^2}\\
&\qquad+\color{blue}{\left(\frac{\partial^2 z}{\partial x\partial y}\cdot\frac{\partial x}{\partial r}
+\frac{\partial^2 z}{\partial y^2}\cdot \frac{\partial y}{\partial r}\right)}\cdot\frac{\partial y}{\partial r}
+\frac{\partial z}{\partial y}\cdot\frac{\partial^2 y}{\partial r^2}\tag{5}\\
&=\frac{\partial^2 z}{\partial x^2}\cdot\left(\frac{\partial x}{\partial r}\right)^2
+\frac{\partial^2 z}{\partial y\partial x}\cdot \frac{\partial x}{\partial r}\cdot\frac{\partial y}{\partial r}
+\frac{\partial z}{\partial x}\cdot\frac{\partial^2 x}{\partial r^2}\\
&\qquad\frac{\partial^2 z}{\partial y^2}\cdot \left(\frac{\partial y}{\partial r}\right)^2
+\frac{\partial^2 z}{\partial x\partial y}\cdot\frac{\partial x}{\partial r}
\cdot\frac{\partial y}{\partial r}
+\frac{\partial z}{\partial y}\cdot\frac{\partial^2 y}{\partial r^2}\tag{6}
\end{align*}

Comment: This is due to presentation issues a rather lengthy calculation. Usually we might skip (3) and (4) and obtain (5) directly from (2).

*

*In (2) we apply the chain rule as we did in (1)


*In (3) we use the linearity of the differential operator


*In (4) we apply  the product rule


*In (5) we apply the chain rule again


*In (6) we multiply out and do a few rearrangements
Special case: $x(r,\theta)=r\cos \theta,\ y(r,\theta)=r\sin \theta$

The partial derivatives of the special case give
\begin{align*}
&x(r,\theta)=r\cos \theta&&\frac{\partial}{\partial r}x(r,\theta)=\cos \theta&&\frac{\partial^2}{\partial r^2}x(r,\theta)=0\\
&y(r,\theta)=r\sin \theta&&\frac{\partial}{\partial r}y(r,\theta)=\sin \theta&&\frac{\partial^2}{\partial r^2}y(r,\theta)=0
\end{align*}
Putting these results in (6) we finally obtain
\begin{align*}
\color{blue}{\frac{\partial^2 }{\partial r^2}}&\color{blue}{f(x(r,\theta),y(r,v\theta))}=\frac{\partial^2 }{\partial r^2}f(r\cos \theta,r\sin \theta)\\
&=\frac{\partial^2 z}{\partial x^2}\cdot \cos^2\theta
+\frac{\partial^2 z}{\partial y\partial x}\cdot \cos \theta\cdot\sin\theta
+\frac{\partial z}{\partial x}\cdot 0\\
&\qquad+\frac{\partial^2 z}{\partial y^2}\cdot \sin^2 \theta
+\frac{\partial^2 z}{\partial x\partial y}\cdot \cos\theta\cdot\sin\theta
+\frac{\partial z}{\partial y}\cdot0\\
&\,\,\color{blue}{=\frac{\partial^2 z}{\partial x^2}\cdot\cos^2\theta
+\left(\frac{\partial^2 z}{\partial y\partial x}+\frac{\partial^2 z}{\partial x\partial y}\right)\cdot\cos \theta\cdot\sin\theta
+\frac{\partial^2 z}{\partial y^2}\cdot\sin^2 \theta}\tag{7}
\end{align*}
in accordance with OPs formula.

