# Finding Trigonometric Fourier Series of Functions of Period 2π

We will now look at some examples of finding the trigonometric Fourier series of various functions. Recall from The Fourier Series of Functions Relative to an Orthonormal System page that if $I$ is an interval of length $2\pi$ and $f \in L(I)$ then the trigonometric Fourier series of $f$ is given by:

(1)Where $\displaystyle{a_n = \frac{1}{\pi} \int_I f(t) \cos nt \: dt}$ and $\displaystyle{b_n = \frac{1}{\pi} \int_I f(t) \sin nt \: dt}$.

On the Trigonometric Fourier Series of Even and Odd Functions page we also looked at some nice shortcut formulas for Fourier series of certain functions. Recall that if $f \in L([-\pi, \pi])$ is a $2\pi$-periodic function and $f$ is even ($f(x) = f(-x)$ for all $x \in [-\pi, \pi]$) then for $\displaystyle{c_n = \frac{2}{\pi} \int_0^{\pi} f(t) \cos nt \: dt}$ we have that:

(2)And if instead $f$ is odd ($-f(x) = f(-x)$ for all $x \in [-\pi, \pi]$) then for $\displaystyle{d_n = \frac{2}{\pi} \int_0^{\pi} f(t) \sin nt \: dt}$ we have that:

(3)Let's look at an example.

Suppose that we want to graph and find the Fourier series for the square-wave function defined by $f(x) = \left\{\begin{matrix} 0 & \mathrm{if} \: -\pi \leq x < 0\\ 1 & \mathrm{if} \: 0 \leq x < \pi \end{matrix}\right.$ where $f(x + 2\pi) = f(x)$ for all $x \in \mathbb{R}$ ($f$ is $2\pi$-periodic). Then:

We also have that:

(4)Therefore the trigonometric Fourier series of $f$ is given by:

(7)