I came across this problem, when trying to find the gradient of a function in polar coordinates. Let's say I have the function $u(r,\phi) = u(\sqrt{x^2+y^2},\arctan(\frac yx)) = f(r\cos\phi,r\sin\phi)=f(x,y)$ and I want to find the partial derivative $\frac{\partial f}{\partial x}$. As far as I understood, I can do the following: $$\frac{\partial f}{\partial x} = \frac{\partial \sqrt {x^2+y^2}}{\partial x}\frac{\partial u}{\partial r}+\frac{\partial \arctan(\frac yx)}{\partial x}\frac{\partial u}{\partial \phi}$$
This is where I am struggling to understand: Usually, I learned to partially derive functions with regard to an argument that only occurs once, so for example deriving this function partially: $f(x,y) = x^2+3y$. For a function like this I can easily derive partially with regards to $x$ and $y$ by just deriving as I am used to and treating the rest like a constant. However, looking at the above equation I am a bit confused : I do understand that I have to use the chain rule for each of the arguments, but how do I justify then just adding the partial derivative of $u$ w.r.t $x$ of the second argument? I have never learned a rule that tells me to just add up both of the partial derivatives. Is this a definition of some sort? Any help is greatly appreciated!
$x = r\cos \phi\\ y = r\sin \phi\\ x^2 + y^2 = r^2\\ \frac yx = \tan \phi$
Lets use a simple example....
$u(r,\phi) = \sqrt {r^2 - 2r\cos\phi}$
$u$ describes a hemisphere centered at (1,0).
We could translate u into Cartesian coordinates $f(x,y) = \sqrt{x^2+ y^2 - 2x}$
and find the partial derivatives $\frac {\partial f}{\partial x} = \frac {x-1}{\sqrt {x^2 + y^2 - 2x}}$
but that is an extra step to go through. So, instead we are going to apply the chain rule.
$\frac {\partial u}{\partial x} = $$\frac{\partial u}{\partial r}\frac{\partial r}{\partial x} + \frac{\partial u}{\partial \phi}\frac{\partial \phi}{\partial x}\\ \frac {r+\cos\phi}{\sqrt{r^2 - 2r\cos\phi}}\frac {x}{\sqrt{x^2 + y^2}} + \frac {r\sin\phi}{\sqrt{r^2 - 2r\cos \phi}}\frac{-y}{x^2 + y^2}\\ \frac {r^2x - x^2- y^2}{r^2\sqrt{r^2 - 2r\cos\phi}}\\ \frac {x - 1}{\sqrt{x^2+y^2 - 2x}}\\ $
So, we have shown that the rule works for this example.
But that is not entirely satisfying, now is it.
Suppose we considered the total derivative of $f(x,y).$ We say that $x(t), y(t)$ are some as of yet undefined functions of $t.$
$\frac {df}{dt} = \frac {\partial f}{\partial x}\frac {dx}{dt} + \frac {\partial f}{\partial y}\frac {dy}{dt}$
and the total derivative of $u(r,\phi)$
$\frac {du}{dt} = \frac {\partial u}{\partial r}\frac {dr}{dt} + \frac {\partial u}{\partial \phi}\frac {d\phi}{dt}$
$r$ is a function of $x,y$, are $\theta$ is a function of $x,y$
$\frac {du}{dt} = \frac {\partial u}{\partial r}(\frac {\partial r}{\partial x}\frac {dx}{dt} + \frac {\partial r}{\partial y}\frac {dy}{dt}) + \frac {\partial u}{\partial \phi}(\frac {\partial \phi}{\partial x}\frac {dx}{dt} + \frac {\partial \phi}{\partial y}\frac {dy}{dt})$
and then we collect the terms like so.
$\frac {du}{dt} = $$(\frac {\partial u}{\partial r}\frac {\partial r}{\partial x}+\frac {\partial u}{\partial\phi}\frac {\partial \phi}{\partial x})\frac {dx}{dt} + (\frac {\partial u}{\partial r}\frac {\partial r}{\partial y}+\frac {\partial u}{\partial\phi}\frac {\partial \phi}{\partial y})\frac {dy}{dt}\\ \frac{\partial u}{\partial x} \frac {dx}{dt} + \frac{\partial u}{\partial y} \frac {dy}{dt} $
So, $\frac {\partial u}{\partial x} = \frac {\partial u}{\partial r}\frac {\partial r}{\partial x}+\frac {\partial u}{\partial\phi}\frac {\partial \phi}{\partial x}$
and
$\frac {\partial u}{\partial y} = \frac {\partial u}{\partial r}\frac {\partial r}{\partial y}+\frac {\partial u}{\partial\phi}\frac {\partial \phi}{\partial y}$