A Fourier series is a way to expand a periodic function in terms of sines and cosines. The Fourier series is named after Joseph Fourier, who introduced the series as he solved for a mathematical way to describe how heat transfers in a metal plate.
The GIFs above show the 8-term Fourier series approximations of the square wave and the sawtooth wave.