My problem is the following. I am working with the following function in the xz-space: $B_{\chi}(x,z) = \sqrt{x^2+z^2}$.
I am trying to express this $B_{\chi}$ in the following locally perpendicular coordinates:
$\chi(x,z) = xz$
$\psi(x,z) = \frac{z^2-x^2}{2}$.
What I did is put $x = \frac{\chi}{z}$ in the expression for $\psi$:
$\psi = \frac{z^2 - \frac{\chi^2}{z^2}}{2}$. This is a biquadratic equation in $z$, which has the solutions $z=$
$\sqrt{\psi+\sqrt{\chi^2+\psi^2}}$, $-\sqrt{\psi+\sqrt{\chi^2+\psi^2}}$, $\sqrt{\psi-\sqrt{\chi^2+\psi^2}}$ and $-\sqrt{\psi-\sqrt{\chi^2+\psi^2}}$.
I would then discard the two last solutions because they are not real, while $z$ must be real since it's a spatial coordinate. If we then take the first, positive, solution $z = \sqrt{\psi+\sqrt{\chi^2+\psi^2}}$ together with $x=\frac{\chi}{z} = \frac{\chi}{\sqrt{\psi+\sqrt{\chi^2+\psi^2}}}$, we would then have an expression for $B_{\chi}$ in terms of the locally perpendicular coordinates $\chi$ and $\psi$:
$B_{\chi}(\chi,\psi) =\sqrt{x^2+z^2} = \sqrt{\frac{\chi^2}{\psi+\sqrt{\chi^2+\psi^2}} + \psi+\sqrt{\chi^2+\psi^2}} = \sqrt{2} \cdot (\chi^2+\psi^2)^{1/4}$.
While it appears I have the solution, there is still a problem: using the chain rule, I can find that
$\displaystyle\frac{\partial B_{\chi}}{\partial \chi} = \frac{\partial B_{\chi}}{\partial x} \frac{\partial x}{\partial \chi} + \frac{\partial B_{\chi}}{\partial z} \frac{\partial z}{\partial \chi} = \frac{\partial \sqrt{x^2+z^2}}{\partial x} \frac{1}{\frac{\partial (xz)}{\partial x}} + \frac{\partial \sqrt{x^2+z^2}}{\partial z} \frac{1}{\frac{\partial (xz)}{\partial z}} = \frac{\sqrt{x^2+z^2}}{xz} = \frac{B_{\chi}}{\chi}$.
So we should have $\frac{\partial B_{\chi}}{\partial \chi} = \frac{B_{\chi}}{\chi}$, but when I take the derivative of $B_{\chi}(\chi,\psi)$ here above with respect to $\chi$, I don't get $\frac{B_{\chi}(\chi,\psi)}{\chi}$. Instead, I get
$\displaystyle\frac{\partial B_{\chi}}{\partial \chi} = \frac{2 \chi}{B_{\chi}^3}$.
So my question is, where am I wrong?
For those that are interested in the answer, I figured out that
\begin{equation}\displaystyle\frac{\partial x}{\partial \chi} \neq \frac{1}{\frac{\partial \chi}{\partial x}} \end{equation}
as would be the case for 1D derivatives. The reason is that in $\frac{\partial x}{\partial \chi}$ we hold $\psi$ constant while in $\frac{\partial \chi}{\partial x}$ we hold $z$ constant. For the equality above to be true we would need to hold $\psi$ constant in $\frac{\partial \chi}{\partial x}$, instead of $z$. The same arguement holds for $\frac{\partial z}{\partial \chi}$
Hence $\frac{\partial B_{\chi}}{\partial \chi} \neq \frac{B_{\chi}}{\chi}$ and I figured out that the correct answer is given by $\frac{\partial B_{\chi}}{\partial \chi} = \frac{2 \chi}{B_{\chi}^3}$.