## Introduction to Electrodynamics 4e

$r = \sqrt{x^2 + y^2 + z^2}$ $\theta = cos^{-1}(\frac{z}{\sqrt{x^2 + y^2 + z^2}})$ $\phi = tan^{-1}(\frac{y}{x})$
Beginning with the following : $x = rsin\theta cos\phi \ \ y = r sin\theta sin\phi \ \ z = r cos\theta$ We can derive $r,\theta,\phi$ as follows $x^2 + y^2 + z^2 = r^2(sin^2\theta cos^2\phi + sin^2\theta sin^2\phi + cos^2\theta)$ $= r^2(sin^2\theta)(cos^2\phi + sin^2\phi)+ cos^2\theta$ $= r^2(sin^2\theta + cos^2\theta) = r^2$ $r = \sqrt{x^2 + y^2 + z^2}$ From $z = r cos\theta$ we can substitute the above expression for r and solve for $\theta$ $\theta = cos^{-1}({\frac{z}{\sqrt{x^2 + y^2 + z^2}}})$ If we reduce the sphere to a circle on the xy plane (where $\phi$ is defined) and enforce $z = 0, \theta = \frac{\pi}{2}$ we have the familiar polar equations $x = rcos\phi \ \ y = rsin\phi \ \ r^2 = x^2 + y^2$ $\frac{y}{x} = \frac{rsin\phi}{rcos\phi} = tan\phi$, so: $\phi = tan^{-1}(\frac{y}{x})$