The gravitational potential at a point $P:(x, y, z)$ due to a unit mass at $\left(x_0, y_0, z_0\right)$ is
$$
\varphi(x, y, z)=\frac{1}{\sqrt{\left(x-x_0\right)^2+\left(y-y_0\right)^2+\left(z-z_0\right)^2}}
$$
For some purposes (such as in astronomy) it is convenient to expand $\varphi(x, y, z)$ in powers of $r$ or $1 / r$,
where $r=\sqrt{x^2+y^2+z^2}$. To do this, introduce the angle shown in Figure 16.4. Let $d=\sqrt{x_0^2+y_0^2+z_0^2}$ and $R=\sqrt{\left(x-x_0\right)^2+\left(y-y_0\right)^2+\left(z-z_0\right)^2}$.
(Figure Cant Copy)
(a) Use the law of cosines to write
$$
\varphi(x, y, z)=\frac{1}{d \sqrt{1-2(r / d) \cos (\theta)+(r / d)^2}}
$$
(b) From our discussion of the generating function for Legendre polynomials, recall that, if $1 / \sqrt{1-2 a t+t^2}$ is expanded in a series about 0 , convergent for $|t|<1$, then the coefficient of $t^n$ is $P_n(a)$.
(c) If $r<d$, let $a=\cos (\theta)$ and $t=r / d$ to obtain
$$
\varphi(r)=\sum_{n=0}^{\infty} \frac{1}{d^{n+1}} P_n(\cos (\theta)) r^n
$$
(d) If $r>d$, show that
$$
\varphi(r)=\frac{1}{r} \sum_{n=0}^{\infty} d^n P_n(\cos (\theta)) r^{-n}
$$