Answer
a) $\rho=\cot \phi \csc\phi$
b) $\rho=\cot \phi \csc\phi \sec 2 \theta $
Work Step by Step
Conversion of rectangular to spherical coordinates is as follows:
$x=\rho \sin \phi \cos \theta; y=\rho \sin \phi \sin \theta;z=\rho \cos \phi$
and
$\rho=\sqrt {x^2+y^2+z^2}$;
$\cos \phi =\dfrac{z}{\rho}$; $\cos \theta=\dfrac{x}{\rho \sin \phi}$
a) Here, $z=x^2+y^2$
This implies that $\rho \cos \phi=(\rho \sin \phi \cos \theta)^2+(\rho \sin \phi \sin \theta)^2$
$\rho \cos \phi=\rho^2 \sin^2 \phi$
Thus, $\rho=\cot \phi \csc\phi$
b) Here, $z=x^2-y^2$
This implies that $\rho \cos \phi=(\rho \sin \phi \cos \theta)^2-(\rho \sin \phi \sin \theta)^2$
$\rho \cos \phi=\rho^2 \sin^2 \phi \cos 2 \theta$
Thus, $\rho=\cot \phi \csc\phi \sec 2 \theta $