The seismic energy-based design concept is attracting increasing attention due to its known advantages such as counting for frequency content of earthquake and duration-related cumulative damage. The concept requires the solution of a relatively complex integration namely the energy balance equation. Thus, some researchers have preferred to use equivalent parameters (e.g. spectral velocity) and prediction equations for the determination of seismic energy. In this study, a piecewise integration technique is proposed to achieve the exact solution of the energy balance equation. The proposed algorithm was validated through shake table tests conducted on the single degree of freedom (SDOF) and multi-degree of freedom (MDOF) systems in elastic and inelastic ranges, as well as analyses of the nonlinear response history of a benchmark frame. To evaluate the efficiency of the proposed solution technique, two MDOF specimens were supplemented by metallic dampers to have discrete damping properties. The seismic energy responses of all specimens with and without metallic dampers were determined satisfactorily. A maximum relative difference of 15% was obtained between the algorithm and the results of the experimental and numerical examples used for the validation.