The novelty of this study is a variational approach for estimating the temperature distribution in the body of a rectangular parallelepiped shape when a heat flow enters one of the faces of a rectangular parallelepiped, and heat exchange with the environment occurs on the opposite side. At the same time, options are considered when the remaining faces of a rectangular parallelepiped are thermally insulated or vice versa. My contribution of this work is that we calculated the laws of temperature distribution when dividing a rectangular parallelepiped into a different number of elements. It is shown that acceptable accuracy is achieved already by dividing the sides of a rectangular parallelepiped into three or 4 parts. In addition, a comparison of the temperature distribution law for a rectangular parallelepiped and a rod close in size, other things being equal, was carried out. Their slight difference is shown.