Precursor to the Fourier Transform actually.
It shows that any periodic function can be represented as a superposition of sine and cosine functions as harmonic frequencies.
Mathematical Definition
Given a periodic function which has a period of
Where coefficients and are found by:

Extension to Non-Periodic
Its pretty simple, you just:
- pretend that the bounds of your non-periodic function is a single period
- fit a Fourier Series on that pseudo-periodic function ()
- the series will match perfectly within the bounds and just repeat forever after that.
