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.

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)$.
