Deriving the cartesian del operator from cylindrical del operator I'm having trouble going from the cylindrical form of the del operator to the cartesian form. Here is my attempt so far:
$\rho = \sqrt{x^2 + y^2}$
$\theta = \arctan(\frac{y}{x})$
$\nabla = \frac{\partial}{\partial \rho} \hat{\rho} + \frac{1}{\rho} \frac{\partial}{\partial \theta} \hat{\theta} + \frac{\partial}{\partial z} \hat{z} $
$\frac{\partial}{\partial \rho} = \frac{\partial x}{\partial \rho}\frac{\partial}{\partial x} + \frac{\partial y}{\partial \rho}\frac{\partial}{\partial y}$
$\frac{\partial x}{\partial \rho} = (\frac{\partial \rho}{\partial x})^{-1} = (\frac{x}{\rho})^{-1} = \frac{\rho}{x} = \frac{1}{\cos(\theta)}$
$\frac{\partial y}{\partial \rho} = (\frac{\partial \rho}{\partial y})^{-1} = (\frac{y}{\rho})^{-1} = \frac{\rho}{y} = \frac{1}{\sin(\theta)}$
thus,
$\frac{\partial}{\partial \rho} = \frac{1}{\cos(\theta)}\frac{\partial}{\partial x} + \frac{1}{\sin(\theta)}\frac{\partial}{\partial y}$
Also: $\hat{\rho} = \cos(\theta) \hat{x} + \sin(\theta) \hat{y}$
next,
$\frac{\partial}{\partial \theta} = \frac{\partial x}{\partial \theta}\frac{\partial}{\partial x} + \frac{\partial y}{\partial \theta}\frac{\partial}{\partial y}$
$\frac{\partial x}{\partial \theta} = (\frac{\partial \theta}{\partial x})^{-1} = (\frac{x^2}{y^2 + x^2} \frac{-y}{x^2})^{-1} = -\frac{\rho^2}{y} = -\frac{\rho}{\sin(\theta)}$
$\frac{\partial y}{\partial \theta} = (\frac{\partial \theta}{\partial y})^{-1} = (\frac{x^2}{y^2 + x^2} \frac{1}{x})^{-1} = \frac{\rho^2}{x} = \frac{\rho}{\cos(\theta)}$
thus,
$\frac{\partial}{\partial \theta} = -\frac{\rho}{\sin(\theta)}\frac{\partial}{\partial x} + \frac{\rho}{\cos(\theta)}\frac{\partial}{\partial y}$
also: $\hat{\theta} = -\sin(\theta) \hat{x} + \cos(\theta) \hat{y}$
so:
$\nabla = \frac{\partial}{\partial \rho} \hat{\rho} + \frac{1}{\rho}\frac{\partial}{\partial \theta} \hat{\theta} + \frac{\partial}{\partial z} \hat{z} = (\frac{1}{\cos(\theta)}\frac{\partial}{\partial x} + \frac{1}{\sin(\theta)}\frac{\partial}{\partial y}) (\cos(\theta) \hat{x} + \sin(\theta) \hat{y}) + (-\frac{1}{\sin(\theta)}\frac{\partial}{\partial x} + \frac{1}{\cos(\theta)}\frac{\partial}{\partial y}) (-\sin(\theta) \hat{x} + \cos(\theta) \hat{y}) + \frac{\partial}{\partial z} \hat{z}$
Simplifying this:
$\nabla = \frac{\partial}{\partial x} \hat{x} + \tan(\theta)\frac{\partial}{\partial x} \hat{y} + \cot(\theta)\frac{\partial}{\partial y} \hat{x} + \frac{\partial}{\partial y} \hat{y} + \frac{\partial}{\partial x} \hat{x} - \cot(\theta)\frac{\partial}{\partial x} \hat{y} - \tan(\theta)\frac{\partial}{\partial y} \hat{x} + \frac{\partial}{\partial y} \hat{y} + \frac{\partial}{\partial z} \hat{z}$
$ = 2\frac{\partial}{\partial x} \hat{x} + 2\frac{\partial}{\partial y} \hat{y} + (\tan(\theta) - \cot(\theta))\frac{\partial}{\partial x} \hat{y}
+ (\cot(\theta) - \tan(\theta))\frac{\partial}{\partial y} \hat{x} + \frac{\partial}{\partial z} \hat{z}$
but this isn't the cartesian del operator. Where did I go wrong?
 A: I found my mistake:
$\frac{\partial}{\partial \rho} \neq \frac{1}{\cos(\theta)}\frac{\partial}{\partial x} + \frac{1}{\sin(\theta)}\frac{\partial}{\partial y}$
it actually equals:
$\frac{\partial}{\partial \rho} = \cos(\theta)\frac{\partial}{\partial x} + \sin(\theta)\frac{\partial}{\partial y}$
I was getting confused because I wanted to compute
$\frac{\partial x}{\partial \rho}$ as $(\frac{\partial \rho}{\partial x})^{-1}$ and use $\rho = \sqrt{x^2 + y^2}$, but that "inverse derivative rule" I guess doesn't work for partial derivatives. Also, I was just being dumb because $x = \rho \cos(\theta)$, so $\frac{\partial x}{\partial \rho}$ is quite easy ( just $\cos(\theta)$ )since $\rho$ and $\theta$ are independent of one another. Similar story for $\frac{\partial y}{\partial \rho}$, $\frac{\partial x}{\partial \theta}$, and $\frac{\partial y}{\partial \theta}$.
At the end of the day, the correct expressions are:
$\frac{\partial}{\partial \rho} = \cos(\theta)\frac{\partial}{\partial x} + \sin(\theta)\frac{\partial}{\partial y}$
$\frac{\partial}{\partial \theta} = -\rho\sin(\theta)\frac{\partial}{\partial x} + \rho\cos(\theta)\frac{\partial}{\partial y}$
thus:
$\nabla = \frac{\partial}{\partial \rho} \hat{\rho} + \frac{1}{\ \rho}\frac{\partial}{\partial \theta} \hat{\theta} + \frac{\partial}{\partial z} \hat{z}$
$ = (\cos(\theta)\frac{\partial}{\partial x} + \sin(\theta)\frac{\partial}{\partial y}) (\cos(\theta) \hat{x} + \sin(\theta) \hat{y}) + \frac{1}{\rho}(-\rho\sin(\theta)\frac{\partial}{\partial x} + \rho\cos(\theta)\frac{\partial}{\partial y})(-\sin(\theta) \hat{x} + \cos(\theta) \hat{y}) + \frac{\partial}{\partial z} \hat{z}$
$ =  \cos^2(\theta)\frac{\partial}{\partial x} \hat{x} + \cos(\theta)\sin(\theta)\frac{\partial}{\partial x} \hat{y}+
\cos(\theta)\sin(\theta)\frac{\partial}{\partial y} \hat{x}+
\sin^2(\theta)\frac{\partial}{\partial y} \hat{y}+
\sin^2(\theta)\frac{\partial}{\partial x} \hat{x}-
\cos(\theta)\sin(\theta)\frac{\partial}{\partial x} \hat{y}-
\cos(\theta)\sin(\theta)\frac{\partial}{\partial y} \hat{x}+
\cos^2(\theta)\frac{\partial}{\partial y} \hat{y} + \frac{\partial}{\partial z} \hat{z}$
$ = (\cos^2(\theta) + \sin^2(\theta))\frac{\partial}{\partial x}\hat{x} + (\cos(\theta)\sin(\theta) - \cos(\theta)\sin(\theta))\frac{\partial}{\partial y} \hat{x}+
(\cos^2(\theta) + \sin^2(\theta))\frac{\partial}{\partial y} \hat{y} + (\cos(\theta)\sin(\theta) - \cos(\theta)\sin(\theta))\frac{\partial}{\partial x} \hat{y} + 
\frac{\partial}{\partial z} \hat{z}$
$ = \frac{\partial}{\partial x} \hat{x} + \frac{\partial}{\partial y} \hat{y} + \frac{\partial}{\partial z} \hat{z}$
