In this paper, a numerical study of a buried hemispherical double-pipe heat exchanger with soil by using geothermal energy is presented. Since the local air-wall exchange coefficient throughout the heat exchanger is unknown, a study of mathematics based on the theory of Green's functions in the unsteady state was developed. The complexity of the geometry has led us to develop a numerical study that allows us to obtain results that reflect the importance of heat exchange. The applications are numerous, especially in the storage of energy in the soil to optimize greenhouses according to the cycle of the seasons.