Baron Jean Baptiste Joseph Fourier (1768 − 1830) introduced the idea that any periodic function can be represented
by a series of sines and cosines which are harmonically related.

To consider this idea in more detail, we should introduce some definitions and common terms.

Basic Definitions

A function f (x) is said to have period P if
f (x + P) = f (x) for all x.
Let the function f (x) has period 2π.
In this case, it is enough to consider behavior of the function on the interval [−π, π].

Suppose that the function f (x) with period 2π is absolutely integrable on
[−π, π] so that the following so-called Dirichlet integral
is finite:

Suppose also that the function f (x) is a single valued, piecewise continuous
(must have a finite number of jump discontinuities), and piecewise monotonic (must have a finite number of maxima and minima).

If the conditions 1 and 2 are satisfied, the Fourier series for the function f (x)
exists and converges to the given function (see also
Convergence of Fourier Series
about convergence conditions.)

At a discontinuity x0, the Fouries Series converges to

The Fourier series of the function f (x) is given by

where the Fourier coefficientsa0, an, and bn
are defined by the integrals

Sometimes alternative forms of the Fourier series are used. Replacing an and bn by the new variables
dn and φn or dn and θn, where

we can write:

Fourier Series of Even and Odd Functions

The Fourier series expansion of an even function f (x)
with the period of 2π does not involve the terms with sines and has the form:

where the Fourier coefficients are given by the formulas

Accordingly, the Fourier series expansion of an odd 2π-periodic function f (x)
consists of sine terms only and has the form:

where the coefficients bn are

Below we consider expansions of 2π-periodic functions into their Fourier series, supposing that these expansions exist and are convergent.

Example 1

Let the function f (x) be 2π-periodic and suppose that it is presented by the Fourier series:

Calculate the coefficients a0, an, and bn.

Solution.

To define an, we integrate the Fourier series on the interval [−π, π]:

For all n > 0,

Therefore, all the terms on the right of the summation sign are zero, so we obtain

In order to find the coefficients an at m > 0, we multiply both sides of
the Fourier series by cos mx and integrate term by term:

The first term on the right side is zero. Then, using the well-known trigonometric identities, we have

if m ≠ n.

In case when m = n, we can write:

Thus,

Similarly, multiplying the Fourier series by sin mx and integrating term by term, we obtain the expression
for bm:

Rewriting the formulas for an, bn, we can write the final expressions for the Fourier coefficients:

Example 2

Find the Fourier series for the square 2π-periodic wave defined on the interval [−π, π]:

Solution.

First we calculate the constant a0:

Find now the Fourier coefficients for n ≠ 0:

Since , we can write:

Thus, the Fourier series for the square wave is

We can easily find the first few terms of the series. By setting, for example, n = 5, we get

The graph of the function and the Fourier series expansion for n = 10 is shown in Figure 1.

Fig.1,n = 10

Fig.2,n = 5,
n = 10

Example 3

Find the Fourier series for the sawtooth wave defined on the interval [−π, π] and
having period 2π.

Solution.

Calculate the Fourier coefficients for the sawtooth wave.
Since this function is odd (Figure 2), then a0 = an = 0.
Find the coefficientsbn:

To calculate the latter integral we use integration by parts formula:

Let . Then so the integral becomes

Substituting and for all integer values of n,
we obtain

Thus, the Fourier series expansion of the sawtooth wave is (Figure 2 above)

Example 4

Let f (x) be a 2π-periodic function such that
for . Find the Fourier series for the parabolic wave.

Solution.

Since this function is even, the coefficients bn = 0. Then

Apply integration by parts twice to find:

Since and for integer n,
we have

Then the Fourier series expansion for the parabolic wave is (Figure 3)

Fig.3,n = 2,
n = 5

Fig.4,n = 1,
n = 2

Example 5

Find the Fourier series for the triangle wave

defined on the interval [−π, π].

Solution.

The constant a0 is

Determine the coefficients an:

Integrating by parts, we can write

Then

The values of sin nx at x = 0 or
x = ± π are zero. Therefore,

When n = 2k, then .
When n = 2k + 1, then
Since the function f (x) is even, the Fourier coefficients bn
are zero. Therefore, the complete Fourier expansion for the triangle wave (see Figure 4 above) is

Example 6

Find the Fourier series for the function

defined on the interval [−π, π].

Solution.

First we find the constant a0:

Now we calculate the coefficients an:

Notice that

Since cos (n − 1)π = (−1)n −1,
we get the following expression for the coefficients an:

It's seen that an = 0 for odd n. For even n, when
n = 2k(k = 1,2,3,...), we have

Calculate the coefficients bn. Start with b1:

The other coefficients bn for n > 1 are zero. Indeed,

Thus, the Fourier series of the given function is given by

Graphs of the function and its Fourier expansions for n = 2 and n = 8 are shown
in Figure 5.

Fig.5,n = 2,
n = 8

Fig.6,n = 10

Example 7

Find the Fourier series for the function

defined on the interval [−π, π].

Solution.

Compute the coefficients an:

(These results are obvious since this function is odd.)

Calculate the coefficients bn:

Thus, the Fourier series expansion of the function is given by

The graph of the function and the Fourier series expansion for n = 10 are shown
in Figure 6 above.