The gravitational potential for a uniform planet is given by the integral $$V(X,Y,Z)= \int \frac{G\rho(x,y,z)}{\xi(x-X, y-Y, z-Z)}dxdydz$$ where:
$G$ is the gravitation constant
$\xi$ is distance from the center equal to $\sqrt{X^2+Y^2+Z^2}$
$(x,y,z)$ is the center of the planet at $(0,0,0)$
$(X,Y,Z)$ are the coordinates of a point $P$ outside the planet. The gravitational potential to be calculated is the force that is felt by an object at $P$
$\space$
My question is in one of the steps our professor provides in coming up with this integral. Since the shape is a sphere, I know that the Volume of a sphere in polar coordinates is:
$$V=\int r^2\sin\theta drd\theta d\phi$$
This next step is where I need the clarification. The notes say:
Now we are going to make a clever change in coordinates, replacing $\theta$ with $R$. A famous triangular relation says that $$R^2=r^2 +\xi^2+2r\xi \cos\theta,$$ where $\xi$ is the distance from point P to the center of the planet. The differential keeping r fixed is $$2RdR - 2r\xi \sin\theta d\theta.$$ so, in the volume element replace $$\sin\theta d\theta \rightarrow \frac{R}{r\xi}dR$$ Hence $$\frac{r^2\sin\theta drd\theta d\phi}{R}=\frac{1}{\xi}rdrdRd\phi$$
My main concern is how he arrived to the differential above, and why he replaces $sin\theta d\theta$. If you have any info on the triangulation, that would be helpful but not necessary.
If I well understand we have $R=R(\theta)$, a function of $\theta$, and $r$ and $\xi$ are constant. So, using derivation of the two side of the starting equation, we have:
$$ \frac{d}{d\theta}(R^2)=\frac{d}{d\theta}\left(r^2+\xi+2r\xi\cos \theta \right) $$ that gives:
$$ 2R\frac{dR}{d\theta}=-2r\xi\sin \theta \frac{d\theta}{d\theta} $$
and ''multiplying by $d\theta$'' as usually do physicists, we have
$$ 2RdR=-2r\xi\sin \theta d \theta $$