In classical mechanics, the gravitational potential at a location is equal to the work (energy transferred) per unit mass that is done by the force of gravity to move an object to a fixed reference location. It is analogous to the electric potential with mass playing the role of charge. By convention, the reference location is usually taken at infinity, so the gravitational potential is zero infinitely far away from any mass and negative at any finite distance.
Potential energy 
The gravitational potential (V) is the potential energy (U) per unit mass:
where m is the mass of the object. Potential energy is equal (in magnitude, but negative) to the work done by the gravitational field moving a body to its given position in space from infinity. If the body has a mass of 1 unit, then the potential energy to be assigned to that body is equal to the gravitational potential. So the potential can be interpreted as the negative of the work done by the gravitational field moving a unit mass in from infinity.
In some situations, the equations can be simplified by assuming a field that is nearly independent of position. For instance, in daily life, in the region close to the surface of the Earth, the gravitational acceleration can be considered constant. In that case, the difference in potential energy from one height to another is to a good approximation linearly related to the difference in height:
Mathematical form 
where G is the gravitational constant. The potential has units of energy per unit mass, e.g., J/kg in the MKS system. By convention, it is always negative where it is defined, and as r tends to infinity, it approaches zero.
The gravitational field, and thus the acceleration of a small body in the space around the massive object, is the negative gradient of the gravitational potential. Thus the negative of a negative gradient yields positive acceleration toward a massive object. Because the potential has no angular components, its gradient is:
where x is a vector of length x pointing from the point mass toward the small body and is a unit vector pointing from the point mass toward the small body. The magnitude of the acceleration therefore follows an inverse square law:
The potential associated with a mass distribution is the superposition of the potentials of point masses. If the mass distribution is a finite collection of point masses, and if the point masses are located at the points x1, ..., xn and have masses m1, ..., mn, then the potential of the distribution at the point x is:
where |x − r| is the distance between the points x and r. If there is a function ρ(r) representing the density of the distribution at r, so that dm(r)= ρ(r)dv(r), where dv(r) is the Euclidean volume element, then the gravitational potential is the volume integral
If V is a potential function coming from a continuous mass distribution ρ(r), then ρ can be recovered using the Laplace operator Δ using the formula:
This holds pointwise whenever ρ is continuous and is zero outside of a bounded set. In general, the mass measure dm can be recovered in the same way if the Laplace operator is taken in the sense of distributions. As a consequence, the gravitational potential satisfies Poisson's equation. See also Green's function for the three-variable Laplace equation and Newtonian potential.
Spherical symmetry 
A spherically symmetric mass distribution behaves to an observer completely outside the distribution as though all of the mass were concentrated at the center, and thus effectively as a point mass, by the shell theorem. On the surface of the earth, the acceleration is given by so-called standard gravity g, approximately 9.8 m/s2, although this value varies slightly with latitude and altitude: The magnitude of the acceleration is a little larger at the poles than at the equator because Earth is an oblate spheroid.
Within a spherically symmetric mass distribution, it is possible to solve Poisson's equation in spherical coordinates. Within a uniform spherical body of radius R and density ρ the gravitational force g inside the sphere varies linearly with distance r from the center, giving the gravitational potential inside the sphere, which is
which differentiably connects to the potential function for the outside of the sphere (see the figure at the top).
General relativity 
In general relativity, the gravitational potential is replaced by the metric tensor. When the gravitational field is weak and the sources are moving very slowly compared to light-speed, general relativity reduces to Newtonian gravity, and the metric tensor can be expanded in terms of the gravitational potential.
Multipole expansion 
The potential at a point x is given by
The potential can be expanded in a series of Legendre polynomials. Represent the points x and r as position vectors relative to the center of mass. The denominator in the integral is expressed as the square root of the square to give
where in the last integral, r = |r| and θ is the angle between x and r.
The integrand can be expanded as a Taylor series in Z = r/|x|, by explicit calculation of the coefficients. A less laborious way of achieving the same result is by using the generalized binomial theorem. The resulting series is the generating function for the Legendre polynomials:
valid for |X| ≤ 1 and |Z| < 1. The coefficients Pn are the Legendre polynomials of degree n. Therefore, the Taylor coefficients of the integrand are given by the Legendre polynomials in X = cos θ. So the potential can be expanded in a series that is convergent for positions x such that r < |x| for all mass elements of the system (i.e., outside a sphere, centered at the center of mass, that encloses the system):
The integral is the component of the center of mass in the x direction; this vanishes because the vector x emanates from the center of mass. So, bringing the integral under the sign of the summation gives
This shows that elongation of the body causes a lower potential in the direction of elongation, and a higher potential in perpendicular directions, compared to the potential due to a spherical mass, if we compare cases with the same distance to the center of mass. (If we compare cases with the same distance to the surface the opposite is true.)
Numerical values 
The absolute value of gravitational potential at a number of locations with regards to the gravitation from[clarification needed] the Earth, the Sun, and the Milky Way is given in the following table; i.e. an object at Earth's surface would need 60 MJ/kg to "leave" Earth's gravity field, another 900 MJ/kg to also leave the Sun's gravity field and more than 130 GJ/kg to leave the gravity field of the Milky Way. The potential is half the square of the escape velocity.
|Location||W.r.t. Earth||W.r.t. Sun||W.r.t. Milky Way|
|Earth's surface||60 MJ/kg||900 MJ/kg||≥ 130 GJ/kg|
|LEO||57 MJ/kg||900 MJ/kg||≥ 130 GJ/kg|
|Voyager 1 (17,000 million km from Earth)||23 J/kg||8 MJ/kg||≥ 130 GJ/kg|
|0.1 light-year from Earth||0.4 J/kg||140 kJ/kg||≥ 130 GJ/kg|
Compare the gravity at these locations.
See also 
- Vladimirov 1984, §7.8
- Marion & Thornton 2003, §5.2
- Grøn, Øyvind; Hervik, Sigbjørn ♦ Einstein's general theory of relativity: with modern applications in cosmology Springer, 2007, p. 201
- C. R. Wylie, Jr. 1960,Advanced Engineering Mathematics (McGraw-Hill Book Company), Theorem 2, Section 10.8, p. 454.
- Peter Dunsby (1996-06-15). "Mass in Newtonian theory". Tensors and Relativity: Chapter 5 Conceptual Basis of General Relativity. Department of Mathematics and Applied Mathematics University of Cape Town. Retrieved 2009-03-25.
- Lupei Zhu Associate Professor, Ph.D. (California Institute of Technology, 1998). "Gravity and Earth's Density Structure". EAS-437 Earth Dynamics. Saint Louis University (Department of Earth and Atmospheric Sciences). Retrieved 2009-03-25.
- Charles D. Ghilani (2006-11-28). "The Gravity Field of the Earth". The Physics Fact Book. Penn State Surveying Engineering Program. Retrieved 2009-03-25.
- Thornton, Stephen T.; Marion, Jerry B. (2003), Classical Dynamics of Particles and Systems (5th ed.), Brooks Cole, ISBN 978-0-534-40896-1.
- Rastall, Peter (1991). Postprincipia: Gravitation for Physicists and Astronomers. World Scientific. pp. 7ff. ISBN 981-02-0778-6.
- Vladimirov, V. S. (1971), Equations of mathematical physics, Translated from the Russian by Audrey Littlewood. Edited by Alan Jeffrey. Pure and Applied Mathematics 3, New York: Marcel Dekker Inc., MR 0268497.