MEMS (microelectromechanical systems) with very high quality factors are essential for several applications like ultra-fast and high precision actuators and sensors. Thermoelastic damping is a fundamental dissipation mechanism that always imposes an upper limit on the quality factor of these devices and needs to be understood properly for the accurate prediction of the quality factor. The general theory of thermoelastic damping developed by Zener  and later modified by Lifshitz and Roukes  has been used extensively for studying thermoelastic damping in MEMS. The general theory is applicable for MEMS beams undergoing simple harmonic oscillations in the flexural mode. However, under electrostatic actuation, which is the most popular mode of actuation in MEMS, the nature of the thermoelastic damping in MEMS can be significantly different from that predicted by the general theory of thermoelastic damping. This is due to the nonlinear coupling between the electrostatic force and the displacement of the microstructure giving rise to complex oscillations. The general theory of thermoelastic damping is modified in this paper for predicting thermoelastic damping in MEMS under arbitrary electrostatic actuation forces.