This is just to clarify what the numbers really mean, in case anyone thinks ~50 TW is the total heat energy (i.e. mass * heat capacity * absolute temperature) of the earth. My back of the envelope calculation is the total heat energy (m * Cp * T) = 2.5 E 31 W, using mean temperature of 4500 K (mantle) and 11000 K (core), Cp 1000 (mantle) and 450 (core) (in J / kg), and the fraction of the earth's total mass (6E24 kg) made up by the mantle (0.6) and core (0.3). I'm ignoring temperature dependence of heat capacity because I don't want to look it up. And ignoring latent heat, and other simplifications...
The Earth will be uninhabitable long before the sun goes red giant though! About a billion years from now [1].
[1] http://theconversation.com/the-sun-wont-die-for-5-billion-ye...
Of note, heat flux increases with both absolute temperature and temperate difference. So, with a deep enough bore you could extract GW's of power for thousands of years. 2-4 mi is rather short unless your tapping heat over a large area.
(1)Leftover heat is currently "100 billion times annual world wide energy demand" so this really can be considered 'renewable.'
PS: ~52 TW / 196.9 million miles = 264w/square mile on average. However, energy is not spread anything close to evenly.