In this paper general solution to the problem of finding maximally flat waveforms with finite number of harmonics (maximally flat trigonometric polynomials) is provided. Waveform coefficients are expressed in closed form as functions of harmonic orders. Two special cases of maximally flat waveforms (so-called maximally flat even harmonic and maximally flat odd harmonic waveforms), which proved to play an important role in class-Fand inverse class-Fpower amplifier (PA) operations, are also considered. For these two special types of waveforms, coefficients are expressed as functions of two parameters only. Closed form expressions for efficiency and power output capability of class-Fand inverse class-FPA operations with maximally flat waveforms are also provided as explicit functions of number of a harmonics.