Calculate the unit vectors in the curvilinear coordinate system and show that they are orthogonal
$$u_1=x^2-y^2 \\ u_2=xy \\ u_3=z$$
I'm not really sure how to do this. I know that I need the scale factors for each but I'm confused how they should be calculated and in what coordinate system? So far I understand that
$$\textbf{e}_i=\frac{1}{h_i}\frac{\partial\textbf{r}}{\partial u_i}$$ where
$$h_i =\left| \frac{\partial\textbf{r}}{\partial u_i} \right| $$
but as I said, I'm confused when to do what. The book got no example what so ever..
You will need to find expressions for the curvilinear unit vectors in terms of $x$, $y$ and $z$.
Hint: You can calculate the components of $\frac{\partial\mathbf r}{\partial u_i}$ by inverting the Jacobian of the map $\phi:(x,y,z)\mapsto(u_1,u_2,u_3)$.
We are looking for the vectors $\frac{\partial\mathbf r}{\partial u_i}$, for which we will need to compute the partial derivatives $\frac{\partial x}{\partial u_i}$, $\frac{\partial y}{\partial u_i}$ and $\frac{\partial z}{\partial u_i}$. A straightforward way to do this is to invert the Jacobian matrix of the coordinate map $\varphi: (x,y,z)\mapsto(u_1,u_2,u_3)$: $$ J=\pmatrix{2x & -2y & 0 \\ y & x & 0 \\ 0 & 0 & 1}, $$so$$ J^{-1}=\pmatrix{\frac x{2x^2+2y^2} & \frac{2y}{2x^2+2y^2} & 0 \\ \frac{-y}{2x^2+2y^2} & \frac{2x}{2x^2+2y^2} & 0 \\ 0 & 0 & 1}. $$This coordinate map is locally invertible everywhere except the origin (where $\operatorname{Det}J=0$) and the columns of $J^{-1}$ are the vectors $\frac{\partial\mathbf r}{\partial u_i}$ that we seek. After normalization, we end up with the unit vectors $$\begin{align} \mathbf e_{u_1} &= \left\langle \frac x{\sqrt{x^2+y^2}}, \frac {-y}{\sqrt{x^2+y^2}}, 0\right\rangle \\ \mathbf e_{u_2} &= \left\langle \frac y{\sqrt{x^2+y^2}},\frac x{\sqrt{x^2+y^2}},0\right\rangle \\ \mathbf e_{u_3} &=\langle 0,0,1 \rangle. \end{align}$$ These are mutually orthogonal, as is easily verified by inspection (or by computing dot products). Note that we could’ve worked in two dimensions with just $u_1$ and $u_2$ since it can be seen by inspection of the coordinate map that their unit vectors will be parallel to the $xy$-plane and thus orthogonal to $\mathbf e_{u_3}=\mathbf e_z$.
As a side note, you’ll more often see $u_1=x^2-y^2$ and $u_2=2xy$ so that a factor of $2$ appears in all of their partial derivatives.