Under prescribed thermoelastic stresses and known properties of the matrix and the inclusion in an elastic medium with an inhomogeneity, we find the shape of inhomogeneity that leads to an extremal value of the thermoelastic energy. From the necessary conditions for an extremum of the thermoelastic energy functional we find a condition for seeking the interface. For the case of isotropic cornponents and under loads of stretching (compression) type and uniform heating of the medium the shape of the inclusion can be found explicitly within a certain range of initial parameter values. The results of numerical study are presented and analyzed. One table.