# Polar coordinates complex differentiation

In Proof of Cauchy Riemann Equations in Polar Coordinates the complex differentation was given in polar coordinates as

\begin{align} \notag f'(z) &= u_x+iv_x \\ \notag &= (\cos(\theta)U_r - \tfrac{1}{r}\sin(\theta)U_{\theta})+i(\cos(\theta)V_r - \tfrac{1}{r}\sin(\theta)V_{\theta}) \\ \notag &= (\cos(\theta)U_r + \sin(\theta)V_{r})+i(\cos(\theta)V_r - \sin(\theta)U_{r}) \\ \notag &= (\cos(\theta)- i\sin(\theta))U_r + i(\cos(\theta)-i\sin(\theta))V_r \\ \notag &= e^{-i\theta}( U_r+iV_r) \notag \end{align}

I am confused about the second line because if $x=r\cos\theta$ then

\begin{align} \notag f'(z) &= u_x+iv_x \\ \notag &= \left(U_r \frac{\partial r}{\partial x}+ U_{\theta}\frac{\partial \theta}{\partial x} \right)+i\left(V_r \frac{\partial r}{\partial x}+ V_{\theta}\frac{\partial \theta}{\partial x} \right)\\ \notag &= \left(\frac{1}{\cos(\theta)}U_r -\frac{1}{r\sin(\theta)}U_{\theta}\right)+i\left(\frac{1}{\cos(\theta)}V_r -\frac{1}{r\sin(\theta)}V_{\theta}\right) \\ \notag & \end{align}

because $1=\cos\theta\frac{\partial r}{\partial x}$ and $1=-r\sin\theta\frac{\partial r}{\partial \theta}$

So where did $(\cos(\theta)U_r - \tfrac{1}{r}\sin(\theta)U_{\theta})+i(\cos(\theta)V_r - \tfrac{1}{r}\sin(\theta)V_{\theta})$ come from?

Note that $\frac 1{\partial_r x} \ne \partial_x r$! We have $$\frac{\partial r}{\partial x} = \frac 1{2\sqrt{x^2 + y^2}} \cdot 2x = \frac{x}r = \cos \theta$$ and $$\frac{\partial \theta}{\partial x} = \frac 1{1 + y^2x^{-2}}\cdot \frac{-y}{x^2} = -\frac{y}{r^2} = -\frac 1r \sin\theta$$