In mathematics, a Fourier series decomposes a periodic function or periodic signal into a sum of simple oscillating functions, namely sines and cosines (or complex exponentials). The study of Fourier series is a branch of Fourier analysis. Fourier series were introduced by Joseph Fourier (1768–1830) for the purpose of solving the heat equation in a metal plate. It led to a revolution in mathematics, forcing mathematicians to reexamine the foundations of mathematics and leading to many modern theories such as Lebesgue integration. - Wikipedia

Here are the Fourier Series for a few of the simplest and most common waveforms.

(See general formula for Fourier Series)

Triangular Wave | |

Square Wave | |

Half-wave Rectified Sine Wave | |

Full-wave Rectified Sine Wave | |