# Taking the partial derivative of substitution variables with trig-functions

I have an exercise in mutivariable calculus where I am to transform a function $u(x,y) = u(\rho, \varphi)$ from and to polar coordinates by expressing $\partial u/\partial \rho$ and $\partial u/\partial \phi$, in order to invert the derived expression and then express $\partial u/\partial x$ and $\partial u/\partial y$.

From polar coordinates we have $$\begin{cases} x = \rho \cos{\varphi}\\ y = \rho \sin{\varphi}. \end{cases}$$

So, from this, I use the chain rule to express $\partial u/\partial \rho$ and $\partial u/\partial \varphi$ as $$\begin{cases} \dfrac{\partial u}{\partial \rho} = \cos{\varphi}\dfrac{\partial u}{\partial x} + \sin{\varphi}\dfrac{\partial u}{\partial y}\\ \dfrac{\partial u}{\partial \varphi} = -\rho\sin{\varphi}\dfrac{\partial u}{\partial x} + \rho\cos{\varphi}\dfrac{\partial u}{\partial y}. \end{cases}$$ Then I want to do the same thing for $\partial u/\partial x$ and $\partial u/ \partial y$, so by the chain rule I work with the following: $$\dfrac{\partial u}{\partial x} = \dfrac{\partial u}{\partial \rho}\dfrac{\partial \rho}{\partial x} + \dfrac{\partial u}{\partial \varphi}\dfrac{\partial \varphi}{\partial x}$$ and $$\dfrac{\partial u}{\partial y} = \dfrac{\partial u}{\partial \rho}\dfrac{\partial \rho}{\partial y} + \dfrac{\partial u}{\partial \varphi}\dfrac{\partial \varphi}{\partial y}$$ I use the inverse of the variables $x$ and $y$ to get $\rho$ and $\varphi$, resulting in $$\begin{cases} \rho = \dfrac{x}{\cos{\varphi}} = \dfrac{y}{\sin{\varphi}}\\ \varphi = \arccos{\frac{x}{\rho}} = \arcsin{\frac{y}{\rho}}, \end{cases}$$ in order to differentiate them with respect to $x$ and $y$ and get the previously unknown $$\begin{cases} \dfrac{\partial \rho}{\partial x} = \dfrac{1}{\cos{\varphi}}\\ \dfrac{\partial \varphi}{\partial x} = \dfrac{-1}{\rho \sqrt{1-(x/\rho)^2)}} \\ \dfrac{\partial \rho}{\partial y} = \dfrac{1}{\sin{\varphi}}\\ \dfrac{\partial \varphi}{\partial y} = \dfrac{1}{\rho \sqrt{1-(y/\rho)^2)}} \end{cases}$$

which I had hoped to plug into the equations and have the solution, but the answer is apparently the following: $$\dfrac{\partial u}{\partial x} = \cos{\varphi}\dfrac{\partial u}{\partial \rho} - \dfrac{\sin{\varphi}}{\rho}\dfrac{\partial u}{\partial \varphi}$$ and $$\dfrac{\partial u}{\partial y} = \sin{\varphi}\dfrac{\partial u}{\partial \rho} + \dfrac{\cos{\varphi}}{\rho}\dfrac{\partial u}{\partial \varphi}.$$

I have no idea how they arrive at this answer. Am I doing something incorrectly? Have I missed a trick somewhere? Or is perhaps the answer to the exercise incorrect?

You have : $$\begin{pmatrix}\dfrac{\partial u}{\partial \rho}\\ \dfrac{\partial u}{\partial \varphi} \end{pmatrix}=\begin{pmatrix} \cos{\varphi}&\sin{\varphi}\\ -\rho\sin{\varphi}& \rho\cos{\varphi}\end{pmatrix} \cdot\begin{pmatrix}\dfrac{\partial u}{\partial x}\\ \dfrac{\partial u}{\partial y} \end{pmatrix}$$ and: $$\begin{pmatrix} \cos{\varphi} & \sin{\varphi}\\ -\rho\sin{\varphi}& \rho\cos{\varphi} \end{pmatrix}^{-1}=\frac{1}{\rho}\begin{pmatrix} \rho \cos{\varphi}&-\sin{\varphi}\\ \rho\sin{\varphi}& \cos{\varphi}\end{pmatrix}$$
• The problem is you method is that you need too express $\rho$ and $\varphi$ as function of $x$ and $y$, but you have expressed in function of $x,y,\rho$ and $\varphi$. To give an example from: $$\rho=\frac{x}{\cos(\varphi)}$$ you have: $$\frac{d \rho}{dx}=\frac{1}{\cos(\varphi)}+x\color{red}{ \frac{d\varphi}{dx}} \frac{\sin(\varphi)}{\cos(\varphi)^2}$$ because $\varphi$ and $x$ are not independents. Apr 27 '18 at 16:47
• But the idea is correct :-). With $\rho=\sqrt{x^2+y^2}$ , you obtain: $$\frac{d\rho}{dx}=\frac{x}{\sqrt{x^2+y^2}}$$ and: $$\frac{x}{\sqrt{x^2+y^2}}=\cos(\phi)$$ Apr 27 '18 at 16:49
After you compute $$\pmatrix{u_{\rho}\\u_{\phi}}=\pmatrix{\cos\phi&\sin\phi\\-\rho\sin\phi&\rho\cos\phi}\pmatrix{u_x\\u_y},$$ just invert the matrix.