TITLE: Partial Derivatives: Changing to Polar Coordinates
QUESTION [6 upvotes]: A function say $f$ of $x$, $y$ is away from the origin. This function can be written in polar coordinates as a function of $r$ and $\theta$. Now, if we know what $\frac{\partial f}{\partial x}$ and $\frac{\partial f}{\partial y}$, how can we find $\frac{\partial f}{\partial r}$ and $\frac{\partial f}{\partial \theta}$ and vice versa. Additionally, if we know what $\frac{\partial^2 f}{\partial x^2}$, $\frac{\partial^2 f}{\partial x \partial y}$, and $\frac{\partial^2 f}{\partial y^2}$ is, how can we find $\frac{\partial^2 f}{\partial r^2}$, $\frac{\partial^2 f}{\partial r \partial \theta}$, and $\frac{\partial^2 f}{\partial \theta^2}$ and vice versa.

REPLY [8 votes]: You can consider it to be a derivative of a composite function.
Given
$$
    f(x,y)
$$
And any differentiable transformation $(x,y) \to (u,v)$
$$
    x = g(u,v),
$$
$$
    y = h(u,v)
$$
you can rewrite
$$
    f(x,y) = f(g(u,v), h(u,v))
$$
and so
$$
    \frac{\partial f(x,y)}{\partial u} = \frac{\partial f(g(u,v),h(u,v))}{\partial u} = \frac{\partial f(x,y)}{\partial x} \frac{\partial g(u,v)}{\partial u} + \frac{\partial f(x,y)}{\partial y} \frac{\partial h(u,v)}{\partial u}
$$
In particular, if you change from cartesian to polar coordinates
$$
    x = r\cos\theta,
$$
$$
    y = r\sin\theta
$$
you get
$$
    \frac{\partial f(x,y)}{\partial r} = \frac{\partial f(x,y)}{\partial x} \frac{\partial (r\cos\theta)}{\partial r} + \frac{\partial f(x,y)}{\partial y} \frac{\partial (r\sin\theta)}{\partial r} = \frac{\partial f(x,y)}{\partial x} \cos\theta + \frac{\partial f(x,y)}{\partial y} \sin\theta
$$
Example:
$$
    f(x,y) = x^2y = r^3\cos^2\theta\sin\theta
$$
direct derivation will give you
$$
    \frac{\partial f}{\partial r} = 3r^2\cos^2\theta\sin\theta
$$
By the formula above you get:
$$
    \frac{\partial f}{\partial r} = \frac{\partial f(x,y)}{\partial x} \cos\theta + \frac{\partial f(x,y)}{\partial y} \sin\theta = 2xy \cos\theta + x^2 \cos\theta=
2r^2\cos^2\theta\sin\theta + r^2\cos^2\theta\sin\theta=3r^2\cos^2\theta\sin\theta
$$
This can be generalised to any number of variables and any differentiable transformation of coordinates.