The inhomogeneous one-dimensional heat-diffusion equation is solved semianalytically in a cylindrically layered whole space. An analytic solution of the problem can be derived in the Laplace domain in a straightforward way assuming continuity of temperature and heat flow at the layer boundaries. The time-dependent heat sources can be distributed spatially over the layered whole space. Due to the complexity of the solution in the Laplace domain, the inverse Laplace transform is calculated using a numerical procedure (Gaver-Stehfest algorithm). It is shown that the algorithm is fast, stable, easy to use, and simple to adjust to various models and boundary conditions. The results obtained are accurate to about 0.01 percent. Therefore, it is an excellent tool for geothermal model calculations with cylindrical symmetry and could be useful for the correction of BHT-values or marine heat flow measurements.