\documentclass[a4paper,12pt]{article}
\begin{document}
\newcommand\ds{\displaystyle}
\parindent=0pt

QUESTION

Spherical polar coordinates $(r,\phi,\theta)$ are defined in terms
of cartesian coordinates $(x,y,z)$ by the equations $$x=r\sin
\theta \cos \phi,\ y=r\sin \theta \sin \phi,\ z=r\cos \theta.$$
Calculate $r,\theta$ and $\phi$ in terms of $x,y$ and $z$, and
then the nine partial derivatives $\frac{\partial r}{\partial x}$
etc.

\bigskip

 ANSWER

 $x=r\sin \theta \cos \phi,\ y=r\sin \theta \sin \phi, z=r\cos
 \theta\\
 r=(x^2+y^2+z^2)^\frac{1}{2},\
 \tan \theta =(x^2+y^2)^\frac{1}{2}z^{-1},\ \tan \phi=yx^{-1}$

 $$\frac{\partial r}{\partial
 x}=2x\frac{1}{2}(x^2+y^2+z^2)^{-\frac{1}{2}}=\frac{x}{r},\ \frac{\partial r}{\partial
 y}=\frac{y}{r},\ \frac{\partial r}{\partial
 z}=\frac{z}{r}$$

 $\ds\frac{d \arctan u}{du}=\frac{1}{1+u^2}$

 $\ds\frac{\partial \theta}{\partial
 z}=\frac{\partial \arctan (x^2+y^2)^\frac{1}{2}z^{-1}}{\partial
 z}=\frac{1}{1+(x^2+y^2)z^{-2}}(x^2+y^2)^\frac{1}{2}(-z^{-2})\\=
 \frac{-(x^2+y^2)^\frac{1}{2}}{r^2},\ \\
 \frac{\partial \theta}{\partial
 x}=\frac{1}{1+(x^2+y^2)z^{-2}}2x\frac{1}{2}(x^2+y^2)^{-\frac{1}{2}}z^{-1}
 =\frac{xz}{(x^2+y^2)^\frac{1}{2}r^2},\\
 \frac{\partial \theta}{\partial y}
 =\frac{yz}{(x^2+y^2)^\frac{1}{2}r^2}\\
 \frac{\partial \phi}{\partial
 x}=\frac{1}{1+\left(\frac{y}{x}\right)^2}\left(-\frac{y}{x^2}\right)=-\frac{y}{x^2+y^2},\
 \frac{\partial \phi}{\partial
 y}=\frac{1}{1+\left(\frac{y}{x}\right)^2}\frac{1}{x}=\frac{x}{x^2+y^2},\ \frac{\partial \phi}{\partial
 z}=0$

\end{document}
