If $x=r \sin \theta \cos \phi, y=r \sin \theta \sin \phi$ and $z=r \cos \theta$, then
(a) $x^{2}+y^{2}+z^{2}=r^{2}$
(b) $x^{2}+y^{2}-z^{2}=r^{2}$
(c) $x^{2}-y^{2}+z^{2}=r^{2}$
(d) $z^{2}+y^{2}-x^{2}=r^{2}$
Given:
$x=r \sin \theta \cos \phi$,
$y=r \sin \theta \sin \phi$,
$z=r \cos \theta$
Squaring and adding these equations, we get
$x^{2}+y^{2}+z^{2}=(r \sin \theta \cos \phi)^{2}+(r \sin \theta \sin \phi)^{2}+(r \cos \theta)^{2}$
$\Rightarrow x^{2}+y^{2}+z^{2}=r^{2} \sin ^{2} \theta \cos ^{2} \phi+r^{2} \sin ^{2} \theta \sin ^{2} \phi+r^{2} \cos ^{2} \theta$
$\Rightarrow x^{2}+y^{2}+z^{2}=\left(r^{2} \sin ^{2} \theta \cos ^{2} \phi+r^{2} \sin ^{2} \theta \sin ^{2} \phi\right)+r^{2} \cos ^{2} \theta$
$\Rightarrow x^{2}+y^{2}+z^{2}=r^{2} \sin ^{2} \theta\left(\cos ^{2} \phi+\sin ^{2} \phi\right)+r^{2} \cos ^{2} \theta$
$\Rightarrow x^{2}+y^{2}+z^{2}=r^{2} \sin ^{2} \theta(1)+r^{2} \cos ^{2} \theta$
$\Rightarrow x^{2}+y^{2}+z^{2}=r^{2} \sin ^{2} \theta+r^{2} \cos ^{2} \theta$
$\Rightarrow x^{2}+y^{2}+z^{2}=r^{2}\left(\sin ^{2} \theta+\cos ^{2} \theta\right)$
$\Rightarrow x^{2}+y^{2}+z^{2}=r^{2}(1)$
$\Rightarrow x^{2}+y^{2}+z^{2}=r^{2}$
Hence, the correct option is (a).