# 3. Fourier Series of Even and Odd Functions

This section can make our lives a lot easier because it reduces the work required.

### Revision

Go back to Even and Odd Functions for more information.

In some of the problems that we encounter, the Fourier coefficients *a*_{o}, *a*_{n} or *b*_{n} become **zero** after
integration.

Finding zero coefficients in such problems is time consuming and can be
avoided. With knowledge of **even and odd functions**, a zero
coefficient may be predicted without performing the
integration.

## Even Functions

**Recall: **A function `y = f(t)` is said to be **even** if `f(-t) = f(t)` for all
values of `t`. The graph of an **even** function is always symmetrical
about the ** y-axis** (i.e. it is a mirror image).

### Example 1 - Even Function

`f(t) = 2 cos πt`

The graph of `f(t) = 2 cos πt`, which has amplitude 2 and period 2.

## Fourier Series for Even Functions

For an **even** function `f(t)`, defined over
the range `-L` to `L` (i.e. period = `2L`), we have the following handy short cut.

Since

`b_n=1/Lint_(-L)^Lf(t)\ sin {:(npit)/L:}dt`

and

`f(t)` is even,

it means the integral will have value 0. (See Properties of Sine and Cosine Graphs.)

So for the Fourier Series for an even function, the coefficient *b*_{n } has zero value:

`b_n= 0`

So we only need to calculate *a*_{0} and *a _{n}* when finding the Fourier Series expansion for an even function `f(t)`:

`a_0=1/Lint_(-L)^Lf(t)dt`

`a_n=1/Lint_(-L)^Lf(t)cos{:(n pi t)/L:}dt`

An **even** function has only **cosine** terms
in its Fourier expansion:

`f(t)=a_0/2+sum_(n=1)^oo\ a_n\ cos (n pi t)/L`

## Fourier Series for Odd Functions

**Recall: **A function `y = f(t)` is said to be **odd** if `f(-t) = -
f(t)` for all values of *t*. The graph of an **odd** function is always symmetrical
about the **origin**.

### Example 2 - Odd Function

*f*(*t*) = sin *t*

The graph of `f(t) = sin t`, which has amplitude `1` and period `2pi`.

## Fourier Series for Odd Functions

For an **odd** function `f(t)` defined over the
range `-L` to `L` (i.e. period `= 2L`), we find that `a_n= 0` for all `n`.

We have:

`a_n=1/Lint_(-L)^Lf(t)\ cos{:(n pi t)/L:}dt`

So the **zero coefficients** in this case are: `a_0=
0` and `a_n= 0`. The coefficients `b_n` are given by:

`b_n=1/Lint_(-L)^L\ f(t)\ sin{:(n pi t)/L:}dt`

The Fourier Series for an odd function is:

`f(t)=sum_(n=1)^oo\ b_n\ sin{:(n pi t)/L:}`

An odd function has only **sine** terms in its Fourier
expansion.

## Exercises

1. Find the Fourier Series for the function for which the graph is given by:

Graph of an odd periodic square wave function.

Answer

First, we need to define the function after observing the graph:

`f(t)={(-3, ,-pi {:<=:}t <0),(3, ,0 {:<=:}t <pi) :}`

We can see from the graph that it is periodic, with period `2pi`.

So `f(t) = f(t + 2π)`.

Also, `L=pi`.

We can also see that it is an **odd** function, so we know `a_0=
0` and `a_n= 0`. So
we will only need to find *b*_{n}.

Since `L=pi`, the necessary formulae become:

`b_n=1/piint_(-pi)^pif(t) sin nt\ dt`

`f(t)=sum_(n=1)^oob_n sin nt`

Now

`b_n=1/pi int_(-pi)^pif(t)sin nt\ dt`

`=1/pi(int_(-pi)^0 -3\ sin nt\ dt` `{:+int_0^pi 3\ sin nt\ dt)`

`=3/pi([(cos nt)/n]_(-pi)^0+[-(cos nt)/n]_0^pi)`

`=3/(pi n)(cos 0-cos(-pi n)` `-cos n pi` `{:+cos 0)`

`=3/(pi n)(2-cos pi n-cos pi n)`

`=6/(pi n)(1-cos pi n)`

`=12/(pi n)\ (n\ "odd") or`

`=0\ (n\ "even")`

We could write this as: `b_n=12/(pi(2n-1))\ \ n=1,2,3...` (Substitute `n=1,2,3...` to see how this works.)

So the Fourier series for our odd function is given by:

`f(t)=sum_(n=1)^oo b_n\ sin nt `

`=sum_(n=1)^oo 12/(pi(2n-1))sin(2n-1)t`

`=12/pisum_(n=1)^oo (sin(2n-1)t)/((2n-1)) `

**NOTE:** Since *b*_{n} is non-zero for
*n* odd, we must also have odd multiples of *t* within
the sine expression (the even ones are multiplied by `0`, so will
be `0`).

Checking, we graph the first 5 terms. It should closely resemble the square wave we started with.

`12/pi sum_(n=1)^5 (sin(2n-1)t)/((2n-1))`

`=12/pi(sin t` `+1/3 sin 3t` `+1/5 sin 5t` `+1/7 sin 7t` `{:+1/9 sin 9t)`

Graph of `f(t)`, the Fourier series approximation of a square wave.

We see that the graph of the first 5 terms is certainly approaching the shape of the graph that was in the question. We can be confident we have the correct answer.

2. Sketch 3 cycles of the function represented by

`f(t)=` `{(0",", if , -1<=t<-1/2),(cos 3 pi t",",if , -1/2<=t<1/2),(0",",if , 1/2<=t<1):}`

and `f(t) = f(t + 2)`.

Find the Fourier Series for this function.

Answer

First, we sketch the curve:

Graph of `f(t)`.

This function is an **even function**, so
`b_n= 0`. We only need to find
*a*_{0} and
*a*_{n}.

`a_0 = 1/Lint_(-L)^Lf(t)dt`

`=int_(-1)^1f(t)dt`

`=int_(-1)^(-0.5)0\ dt` `+int_(-0.5)^0.5cos 3pi t\ dt` `+int_0.5^1 0\ dt`

`=[(sin 3pi t)/(3 pi)]_(-0.5)^0.5`

`=-2/(3pi)`

Now for *a*_{n}. We will use Scientific
Notebook to perform the integration:

`a_n=1/Lint_(-L)^Lf(t) cos {:(n pi t)/L:}dt`

`=int_(-1)^1f(t)\ cos n pi t\ dt`

`=0` `+int_(-0.5)^(0.5)cos 3 pi t\ cos n pi t\ dt` `+0`

`=6 (cos {:(n pi)/2 :})/(pi(-9+n^2))`

(We used Scientific Notebook for the final answer.)

Recall that `cos((nπ)/2) = 0` for *n* odd and `+1` or `-1`
for *n* even. (See the Helpful Revision page.)

So we expect 0 for every odd term.

However, we cannot have `n = 3` in this expression, since the denominator would be `0`. In this situation, we need to integrate for `n = 3` to see if there is a value. In fact, we will use SNB to find the values up to `n = 5`, to see what is happening:

When `n=1`,

`int_(-1//2)^(1//2)cos 3 pi t\ cos pi t\ dt=0`

When `n=2`,

`int_(-1//2)^(1//2)cos 3 pi t\ cos 2pi t\ dt=6/(5pi)`

When `n=3`,

`int_(-1//2)^(1//2)cos 3 pi t\ cos 3pi t\ dt=1/2`

(We see there is in fact a value for the integral when `n=3`.)

When `n=4`,

`int_(-1//2)^(1//2)cos 3 pi t\ cos 4pi t\ dt=6/(7pi)`

When `n=5`,

`int_(-1//2)^(1//2)cos 3 pi t\ cos 5pi t\ dt=0`

So we will start our series by writing out the terms for `n = 2` and `n = 3`, then use summation notation from `n = 4`:

`f(t)=a_0/2+sum_(n=1)^oo a_n cos {:(n pi t)/L:}` `+sum_(n=1)^oo b_n sin {:(n pi t)/L:}`

`=a_0/2+6/(5pi) cos 2 pi t+1/2 cos 3pit` `+sum_(n=4)^oo a_n cos {:(npit)/L:}`

`=-1/(3pi)+(6\ cos 2pit)/(5pi)` `+(cos 3pit)/2` `+sum_(n=4)^oo 6 (cos{:(npi)/2:})/(pi(-9+n^2)) cos npit`

As usual, we graph the first few terms and see that our series is correct:

Graph of `f(t)`, the Fourier series approximation of our given periodic function.

#### Solution without Scientific Notebook:

The integration for *a*_{n} could have
been performed as follows. We re-express the function using a trick based on what we learned in Sum and Difference of Two Angles.

In general, `cos(A+B)` `=cosAcosB-sinAsinB`.

If we let

`A=3pit` and `B=npit`,

then the cos expression becomes:

`cos(3pit+npit)` `=cos3pit cos npit - sin3pit sin npit` ... (1)

Taking the negative case:

`cos(3pit-npit)` `=cos3pit cos npit + sin3pit sin npit` ... (2)

Adding equations (1) and (2) gives:

`cos(3pit+npit)+cos(3pit-npit)` `=2cos3pit cos npit`

Reversing sides, dividing both sides by `2`, and factoring, we have:

`cos 3pi t cos n pi t` `=1/2[cos(3+n)pit+cos(3-n)pit]`

So our integral becomes

`int_(-1//2)^(1//2)cos 3pit\ cos npi t\ dt`

`=1/2int_(-1//2)^(1//2)[cos(3+n)pit` `{:+cos(3-n)pit]dt`

`=1/2[(sin(3+n)pit)/((3+n)pi)` `{:+(sin(3-n)pit)/((3-n)pi)]_(-1//2)^(1//2)`

It is then necessary to substitute `t = 1/2` and `t = -1/2`, and subtract as usual, then simplify the expression in `n`.

**After integrating,** we could have expressed
*a*_{n} as follows:

`a_n=6((-1)^(n//2))/(pi(-9+n^2))`, `\ \ n` even (`0` if `n` odd, `n!=3`), or as:

` =6((-1)^n)/(pi(-9+4n^2)),\ \ \n=1,2,3,...`

Then we could have substituted this expression into the series. However, we would still need to consider separately the case when `n = 3`.

**Interactive:** You can explore this example using the interactive Fourier Series graph.

### Search IntMath

### Online Calculus Solver

This calculus solver can solve a wide range of math problems.

Go to: Online calculus solver