Can Gravity be used as an energy source? Let's say there is a planet that is in the middle of nowhere so it isn't moving all the time like a planet in a solar system.
The pressure caused by gravity pulling down towards the centre of mass (the middle of the planet) would heat up the core of the planet.
Couldn't this be used as an infinite source of thermal energy? If not could someone tell me why?
I know that gravity is a force and energy cannot be created nor destroyed. Objects can gain potential gravitational energy by being pulled further away from let's say a planet but this requires energy to do. So does the energy come from the time when the planet formed and the matter became a ball?
 A: You can extract geothermal energy from the interior, but it's not an infinite source of energy. Extracting geothermal energy will make the core cool down a bit faster than it otherwise would (so, in case of a perfectly insulated planet this would be the only source of heat loss), the drop in pressure would make the planet shrink a bit more, so you then get some extra energy by converting more gravitational potential energy to heat. Now the end stage here is a planet with a stable cold core. To extract more energy you would need to actually help gravity by compressing the planet so much that it would collapse under its own gravity to become a black hole. But even considering such an exotic process,  the total energy you can extract will still be finite.
A: It is the "infinite source" that is giving the downvotes. As the answer by Ramchandra Apte states,  gravitational compression is a one way street as far as energy goes.
But of course a complicated state like a planet has energy exchanges with its sun, and one can get transformation of sun energy to gravitational energy as in hydroelectric power..
One can also assume that your planet will have  a magma layer, so it is conceivable, again if the planet has water, to devise an engine that will bring water to the magma layer and get steam and get unlimited energy within the range of  humanity lifetimes, but not infinite supply. The planet will be further cooling if the magma energy is being utilized.
A: The heating is one-time as once the planet reaches equilibrium with gravity (i.e. compression force from gravity equals normal force), no more compression with occur. Basically the planet will compress one-time and that's it.
(In reality, this occurs when the planet forms and its various pieces join together)
