# Computing gravitational potential for a point inside the distribution

1. ### Mike2

The gravitational potential, U, can be calculated at any point, $$${\rm{\vec r}}$$$, for a mass density distribution, $$${\rm{\rho (r)}}$$$, using the formula:

$$${\rm{U = - }}\int_{{\rm{all space}}} {G\frac{{{\rm{\rho }}({\rm{\vec r')}}}}{{\left| {{\rm{ \vec r - \vec r' }}} \right|}}} \,\,\,d^3 {\rm{r'}}$$$.

See:
http://scienceworld.wolfram.com/physics/GravitationalPotential.html

My question is how is this calculated for points inside the distribution. For points outside the distribution, $$${\rm{\rho (r)}}$$$ is zero, and there is no problem. But inside the distribution where $$${\rm{\rho (r)}}$$$ is not zero, there will be points where $$${{\rm{\vec r - \vec r' }}}$$$ does become zero and send the integrand to infinity. Wouldn't this cause a problem? And how would you work around it? Thanks.

Could it be as simple as adding a small constant in the denominator that goes to zero after the integration, such as:
$$${\rm{U(\vec r) = }}\mathop {\lim }\limits_{\varepsilon \to 0} {\rm{( - }}\int_{{\rm{all space}}} {G\frac{{{\rm{\rho }}({\rm{\vec r')}}}}{{\left| {{\rm{ \vec r - \vec r' }}} \right| + \varepsilon }}} \,\,\,d^3 {\rm{r')}}$$$

Last edited: Nov 2, 2005
2. ### ZapperZ

29,833
Staff Emeritus
Er... no. One uses techniques such as residues to do such integration that contains poles.

Zz.

3. ### Mike2

As I recall, residuals have to do with the math of complex numbers, which is a 2D construction resolved with line integrals, when here we have a 3D pole/infinity.

Are you referring to a Stoke's Theorm or a Divergence Theorm to turn integration throughout a volume which has an infinity into a surface integral that surrounds the infinity and so does not integrate through the infinity?

4. ### ZapperZ

29,833
Staff Emeritus
Nah-ah. You only make use of the complex plane when you do the contour integrals. Look at your complex analysis text. You'll see many such integrals (real ones) being done using this technique. This integral is very common in E&M.

Zz.

5. ### Mike2

I've seen where they use contour integrals to integrate real integrands. They substitute a complex variable for the real variable and do a contour integral. But I've not seen them do this for integrands of more than one real variable, have you? If you don't feel like giving a detailed explanation, perhaps you'd give a few keywords I can look up. Thanks.

Last edited: Nov 5, 2005