Using thermal inertia in district heating systems (DHSs) to improve the dispatch flexibility and economy of integrated heat and electricity systems (IHESs) is a research hotspot and difficulty. In most existing studies, the partial differential equations (PDEs) of thermal inertia are approximated by discrete-time models, making it difficult to accurately describe the continuous dynamic processes. In this paper, we propose a novel generalized phasor method (GPM) for thermal inertia in DHSs with constant mass flow. Based on the analytical solution of the PDEs and the Fourier transform, the intractable PDEs are transformed into a series of complex algebraic equations represented by phasors. The GPM has higher accuracy compared to traditional discrete models because it is essentially a continuous model in the time domain. Then, we present a different representation of an integrated heat and electricity dispatch (IHED) model combining a DHS model in phasor form and a traditional electrical power system model. The IHED model is a convex programming problem and can be easily solved. The effectiveness of the proposed GPM and dispatch model is verified in three test systems. Compared with traditional methods for modeling the thermal inertia, the proposed GPM is more accurate.