Get $z=f(x,y)$ with $x=r\cos\theta$ and $y=r\sin\theta$ prove that Get $z=f(x,y)$ with $x=r\cos\theta$ and $y=r\sin\theta$
prove that
$$\frac{\partial^2 z}{\partial r^2}=\frac{\partial^2 z}{\partial x^2} \cos^2\theta+2\frac{\partial^2 z}{\partial x \, \partial y} \sin\theta \cos\theta+\frac{\partial^2 z}{\partial y^2} \sin^2\theta$$

Find the solution but I don't know if it's correct
find $$\frac{\partial z}{\partial r}=\frac{\partial z}{\partial x} \cos\theta+\frac{\partial z}{\partial y}\sin\theta
$$
Having this the only thing it does is ^2 to get the result, is this procedure ok?
 A: As noted in a comment, squaring a first derivative does not yield a second derivative. So let me try and guide you through the process of taking a multivariate second derivative.
Recall that
$$\frac{\partial z}{\partial r}=\frac{\partial z}{\partial x} \frac{\partial x}{\partial r} + \frac{\partial z}{\partial y} \frac{\partial y}{\partial r}$$
We can replace some of these partials since we know $x = r \cos{\theta}$ and $y = r \sin{\theta}$:
$$\frac{\partial z}{\partial r}=\frac{\partial z}{\partial x} \cos{\theta} + \frac{\partial z}{\partial y} \sin{\theta}$$
Now let's repeat this process and take a second derivative, keeping in mind that the first derivatives are still functions of $x$ and $y$:
$$\frac{\partial^2 z}{\partial r^2} = 
\frac{\partial^2 z}{\partial x^2} \frac{\partial x}{\partial r} \cos{\theta} + \frac{\partial^2 z}{\partial x \partial y} \frac{\partial y}{\partial r} \cos{\theta} +
\frac{\partial^2 z}{\partial y \partial x} \frac{\partial x}{\partial r} \sin{\theta} + \frac{\partial^2 z}{\partial y^2} \frac{\partial y}{\partial r} \sin{\theta}$$
Let's simplify:
$$\frac{\partial^2 z}{\partial r^2} = 
\frac{\partial^2 z}{\partial x^2} \cos^2{\theta} + \frac{\partial^2 z}{\partial x \partial y} \sin{\theta} \cos{\theta} +
\frac{\partial^2 z}{\partial y \partial x} \cos{\theta} \sin{\theta} + \frac{\partial^2 z}{\partial y^2} \sin^2{\theta}$$
Now let's use this fact about partial derivatives
$$\frac{\partial^2 z}{\partial x \partial y} =\frac{\partial^2 z}{\partial y \partial x}$$
This leads us to our required expression:
$$\frac{\partial^2 z}{\partial r^2}=\frac{\partial^2 z}{\partial x^2} \cos^2\theta+2\frac{\partial^2 z}{\partial x \, \partial y} \sin\theta \cos\theta+\frac{\partial^2 z}{\partial y^2} \sin^2\theta$$
Hope this helps!
