Solution (source code)

= Solution
{c}

For a volume source of constant <mass density> $\rho$, use $dm=\rho\,dV'$. Its <Newtonian gravitational potential> is the <volume integral>
$$
\boxed{\phi(\mathbf r)=-G\rho\iiint_V\frac{dV'}{|\mathbf r-\mathbf r'|},\qquad\phi(\infty)=0.}
$$
The source and observation <position vectors> are $\mathbf r'$ and $\mathbf r$, respectively; $G$ is the <gravitational constant>. With this sign convention positive source <mass> gives negative <Newtonian gravitational potential>.