The mechanism was originally proposed by Kelvin and Helmholtz in the late 1800s to explain the source of energy of the sun. By the mid 19th century, conservation of energy had been accepted, and one consequence of this law of physics is that the sun must have some energy source to continue to shine. Because nuclear reactions were unknown, the main candidate for the source of solar energy was gravitational contraction.
However, it was soon was recognized by Sir Arthur Eddington and others that the total amount of energy available via this mechanism only allowed for the sun to shine for millions of years rather than the billions of years that the geological and biological evidence suggested for the age of the earth. The true source of the Sun's energy remained uncertain until the 1930's in which it was shown to be nuclear fusion by Hans Bethe.
It was theorised that the gravitational potential energy from the contraction of the sun could be its source of power. To calculate the total amount of energy that would be released by the sun in such a mechanism (assuming uniform density), it was approximated to a perfect sphere made up of concentric shells. The gravitational potential energy could then be found as the integral over all the shells from the centre to its outer radius.
Gravitational potential energy from Newtonian mechanics is defined as:
Where G is the gravitational constant, and the two masses in this case are that of the thin shells of width dr, and the contained mass within radius r as one integrates between zero and the radius of the total sphere. This gives:
Where R is the outer radius of the sphere, and m(r) is the mass contained within the radius r. Changing m(r) into a product of volume and density to satisfy the integral:
Recasting in terms of the mass of the sphere gives the final answer:
While uniform density is not correct, one can get a rough order of magnitude estimate of the expected lifetime of our star by inserting known values for the mass and radius of the sun, and then dividing by the known luminosity of the sun. Note this will involve another approximation, as the power output of the sun has not always been constant.
Where L is the luminosity of the sun. While giving enough power for considerably longer than many other physical methods, such as electrochemical energy, this value was clearly still not long enough due to geological and biological evidence that the earth was billions of years old. It was eventually discovered that thermonuclear energy was responsible for the power output and long lifetimes of stars.