In a past exam paper that I am using to prepare for my upcoming finals, I have encountered the following question (paraphrased):
Given the metric: $$\mathrm{d}s^{2} = -c^{2}\:\mathrm{d}t^{2}+\left(\frac{R^{2}}{r^{2}+\alpha^{2}}\right)\:\mathrm{d}r^{2}+R^{2}\:\mathrm{d}\theta^{2}+(r^{2}+\alpha^{2})\sin^{2}(\theta)\:\mathrm{d}\phi^{2}$$Where $R^{2} = r^{2} + \alpha^{2}\cos^{2}(\theta)$, and the co-ordinate transformations: $$\begin{align*}x &= \sqrt{r^{2}+\alpha^{2}}\sin(\theta)\cos(\phi) \\ y&= \sqrt{r^{2}+\alpha^{2}}\sin(\theta)\cos(\phi) \\ z &= r\cos(\theta)\end{align*}$$ Where $t$ is unchanged. We can express the metric in the form: $$\mathrm{d}s^{2}=-c^{2}\:\mathrm{d}t^{2}+f^{2}\:\mathrm{d}x^{2} + g^{2}\:\mathrm{d}y^{2}+h^{2}\:\mathrm{d}z^{2}$$ Determine the functions $f$, $g$ and $h$.
I am struggling with this, possibly because it's been several years since I did linear algebra properly and so I cannot see the easiest way to approach this problem. I have tried isolating $\mathrm{d}r$, $\mathrm{d}\theta$, and $\mathrm{d}\phi$ in terms of the other variables so I can substitute these into the metric, but without much luck.
Converting the metric to cartesian coordinates does look pretty messy. One way to approach this sort of problem in general is to compute the Jacobian of the coordinate map, rewrite the resulting partial derivatives in terms of $x$, $y$ and $z$, and then invert the resulting matrix to get the partial derivatives of the inverse map. Since $r$ and $\theta$ appear in the metric, you might not need to eliminate them entirely—the hope is that they’ll cancel out or end up in expressions that are more easily converted to functions of $(x,y,z)$ after squaring and adding everything up.
In this case, coming at it from the other direction is worth a shot. The coordinate transformation looks similar to the standard spherical-to-cartesian map, but with $r$ partially replaced with $\sqrt{r^2+\alpha^2}$. The metric also looks a lot like the Euclidean metric in spherical coordinates—for the coefficient of $d\theta^2$ you have $R^2$ instead of $r^2$ and likewise the coefficient of $d\phi^2$ is $(r^2+\alpha^2)\sin^2\theta$ instead of $r^2\sin^2\theta$. Try computing $dx^2+dy^2+dz^2$ and see how close it comes to the given metric. That should give you an idea of what $f$, $g$ and $h$ might be (and you might even be pleasantly surprised).
Update: Instead of guessing, you can proceed directly by using the formula for coordinate transformations of the metric tensor: $$g_{\alpha\beta}={\partial x^\mu\over\partial y^\alpha}{\partial x^\nu\over\partial y^\beta}g_{\mu\nu}.$$
We’re given that all of the off-diagonal components are zero in both coordinate systems. Taking $g_{\phi\phi}$ first, we have $$\begin{align} g_{\phi\phi} &= \left(\partial x\over\partial\phi\right)^2f^2+\left(\partial y\over\partial\phi\right)^2g^2+\left(\partial z\over\partial\phi\right)^2h^2 \\ &= \left(-\sqrt{r^2+\alpha^2}\sin\theta\sin\phi\right)^2f^2+\left(\sqrt{r^2+\alpha^2}\sin\theta\cos\phi\right)^2g^2+0\cdot h^2 \\ &= (f^2\sin^2\phi+g^2\cos^2\phi)(r^2+\alpha^2)\sin^2\theta \\ &= (r^2+\alpha^2)\sin^2\theta \end{align}$$ which gives $f^2\sin^2\theta+g^2\cos^2\theta=1$. Continuing in a similar vein, from the coefficient of $\alpha^2\cos^2\theta$ in $g_{\theta\theta}$ we get $$ f^2\cos^2\phi+g^2\sin^2\phi=1. $$ These two conditions yield $f^2=g^2=1$. Plugging these values into $g_{rr}$ and comparing the coefficients of $\cos^2\theta$ gives $$ h^2\alpha^2+(h^2-1)r^2=\alpha^2, $$ so $h^2=1$. You can verify that this value of $h^2$ also produces the correct result for $g_{\theta\theta}$.