Due to the limited amount of oil reserves, it is essential to ensure the efficient use of available energy, which is closely linked to the optimal design of electrical devices. Because these devices work with electrical energy, they cannot avoid having discrete heat generating sources and their design depends on the precise determination of the temperature field in the body. In this work, the integral method of Green's functions is used to determine the three-dimensional temperature distribution of a homogeneous medium due to a rectangular waveshaped heat generation source. The geometry of the heat generation has been selected in such a way that it has the typical shape of the commercially available flexible electric heaters. The solution obtained is exact and mathematically simple. To demonstrate the versatility of the results, this analytical solution has been compared with the purely numerical solution obtained using a computer package widely used in engineering (COMSOL Multiphysics). The analytical and numerical results coincide well in all the evaluated ranges. Using the equation obtained in this work, a procedure is proposed to determine the effective thermal conductivity of a material from the experimental data of temperature and position. The results of this research offer a simple way to calculate the thermal conductivity of a material and can be applied in the design of thermo-optical devices, flexible electric heaters or thermo-adjustable microfluidic devices.