What's my $\mathrm dM$? Gravitational Potential inside a circle of mass 
I'm trying to find the gravitational potential for an arbitrary point within a ring of uniform mass density. The point is constrained to be in the same plane as the ring.

So we start with:
$$\Phi=\int G\frac{\mathrm dM}{r}$$
Let's assume that the point of interest is along the $x$ axis $r$ away from the origin (which is at the center of the ring). An arbitrary point on the ring lies at:
$$a\cos\phi\hat{x}+a\sin\phi\hat{y}$$
And of course the point of interest is:
$$r\hat{x}$$
The distance between the point of interest and an arbitrary point on the ring is then:
$$\sqrt{r^2-2ar\cos\phi+a^2}$$
Back to the integral above, we get:
$$\Phi=\int G\frac{\mathrm dM}{\sqrt{r^2-2ar\cos\phi+a^2}}$$
Cool. I'm pretty happy up to this point, but what do I do about the $\mathrm dM$? Were I at the center of the circle, I would use $\mathrm dM=r\mathrm d\phi$. But I feel like it shouldn't be that simple if the center of my integration isn't the center of the circle. Should I use $$\sqrt{r^2-2ar\cos\phi+a^2}\mathrm d\phi~?$$ Am I completely off base here?
 A: I think the following diagram should help:

It is perfectly legal (and makes the math simpler) to use the center of the circle as the "center of integration", as long as you use the right value of $d$ for the distance to the mass element $dM$.
So your equation for the potential should use $d=\sqrt{a^2+r^2-2ar\cos\phi}$, and then you can express everything in terms of the angle $\phi$ and the total mass of the ring, $M$:
$$\begin{align}\Phi &= \int G\frac{dM}{d}\\
&= \int G\frac{M d\phi}{2\pi a ~d}\\
&= \int_0^{2\pi} G\frac{M d\phi}{2\pi a ~\sqrt{a^2+r^2-2ar\cos\phi}}\end{align}$$
A: $\mathrm dM$ is just $\rho \mathrm dV$, where $\rho$ is the density and $\mathrm dV$ is the volume element. 
In your case then $\mathrm dM = \delta(r-R)\delta (\theta - \pi/2)\lambda r^2 \, \mathrm dr \, \mathrm d\theta \, \mathrm d\phi = \lambda R \, \mathrm d\phi$
A: It depends, is the ring infinitely thin? In other words, do they give you $\lambda$ (density per length) or $\rho$ (density per volume). If they give $\lambda$, then $dM=\lambda rd\phi$. This is because $rd\phi$ is a differential length, and multiplying it by $\lambda$ gives you the differential mass at that point. Then you just integrate from $\phi = 0$ to $\phi = 2\pi$. 
More formula, you can do what Martin Ueding else posted and integrate over all space and include Dirac delta functions in the density so that, in the end, you get only a nonzero contribution from the integrating over the ring anyway.
