Parametrization of a particular surface of revolution Consider the mapping $f: \mathbb R^3 \to \mathbb R$ where
$$f(x,y,z)=z^2+\left(\sqrt{x^2+y^2}-a\right)^2-r^2, \qquad r >a>0.$$
How can I find a parametrization of $f^{-1}(0)$ as a surface of revolution? Or how do I approach problems like these in general?
 A: The set $f^{-1}(0)$ is the locus of points satisfying
$$0 = z^2 + \left(\sqrt{x^2 + y^2} - a\right)^2 - r^2 .$$
Since $x$ and $y$ only appear in the expression $\sqrt{x^2 + y^2}$, which is the distance from the point $(x, y, z)$ to the $z$-axis, if a point $(x, y, z)$ is in this locus, so is the point given by rotating $(x, y, z)$ about the $z$-axis by any angle, so this surface really is a surface of revolution as claimed.
Hint The idea of a surface-of-revolution parameterization is to exploit exactly this symmetry. Introduce new variables $\rho$ and $\theta$, defined by $x = \rho \cos \theta$ and $y = \rho \sin \theta$---essentially $(\rho, \theta)$ define polar coordinates on the $xy$-plane---so that $\rho = \sqrt{x^2 + y^2}$. Then, rearranging the above equation yields
$$z^2 + (\rho - a)^2 = r^2 ,$$
which we can recognize as the equation of a circle in the coordinates $\rho, z$, with center $(a, 0)$ and radius $r$.
Can you parameterize this circle (say, with parameter $\varphi$)? With that parameterization in hand, you can substitute the expression for $\rho$ in the coordinate change equations for $x, y$, and so produce the desired parameterization, i.e., write $x, y, z$ as functions of $\theta, \phi$.

More generally, if we have a surface of revolution (about, say, the $z$-axis), we can proceed as before, making the same substitutions for $x$ and $y$, giving an equation for the surface of the form $$g(\rho, z) = 0 .$$
If we regard this formally as an equation in the $\rho z$ plane, we can regard to locus of solutions of $g(\rho, z) = 0$ as a curve, we can look for a parameterization $(\rho(\varphi), z(\varphi))$ of this curve, and substitute to produce a parameterization
$$(x(\theta, \varphi), y(\theta, \varphi), z(\theta, \varphi)) = (\rho(\varphi) \cos \theta, \rho(\varphi) \sin \theta, z(\varphi)) $$
of the surface of revolution.
A: In cylindrical coordinates, you need to solve
$$z^2+(\rho-a)^2-r^2=0.$$
You can write
$$\rho=a\pm\sqrt{r^2-z^2},$$
which represents a torus of small radius $r$ and large radius $a$ (but as $r>a$, this is a self-intersecting torus).
