PAGE 1

9.1 (Continued)

1

If \( f(x) \) is periodic w/ period \( 2\pi \) and defined on \( -\pi < x < \pi \), then its Fourier series representation is

\[ \frac{1}{2} a_0 + \sum_{n=1}^{\infty} [a_n \cos(nx) + b_n \sin(nx)] \]

where

\[ a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos(nx) \, dx \] \( n = 0, 1, 2, 3, \dots \)
\[ b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin(nx) \, dx \] \( n = 1, 2, 3, \dots \)

Last time:

\[ f(x) = \begin{cases} 1 & \text{if } -\pi < x < 0 \\ 0 & \text{if } 0 < x < \pi \end{cases} \quad \text{period } 2\pi \]
A graph of a periodic step function f(x) with period 2\pi. The x-axis is labeled with multiples of \pi: -\pi, 0, \pi, 2\pi, 3\pi. The y-axis is labeled f(x). The function consists of horizontal line segments. From x = -\pi to 0, the function is at y = 1. From x = 0 to \pi, the function is at y = 0. This pattern repeats: from \pi to 2\pi, y = 1; from 2\pi to 3\pi, y = 0.
Graph of the periodic step function \( f(x) \) with period \( 2\pi \).
PAGE 2

we found \( a_0 = 1 \), \( a_n = 0 \) for \( n \ge 1 \)

\[ b_n = -\frac{1}{n\pi} (1 - (-1)^n) = \begin{cases} 0 & \text{if } n \text{ is even} \\ -\frac{2}{n\pi} & \text{if } n \text{ is odd} \end{cases} \]

The function's Fourier series representation is

\[ f(x) \sim \frac{1}{2}(1) + \sum_{n=1}^{\infty} -\frac{1}{n\pi} (1 - (-1)^n) \sin(nx) \]
converges to true function \( f(x) \)
\[ \sim \frac{1}{2} - \frac{2}{\pi} \sin(x) - \frac{2}{3\pi} \sin(3x) - \frac{2}{5\pi} \sin(5x) - \dots \]

Just like Taylor series, the more terms we include, the closer the Fourier series will resemble the true \( f(x) \).

A graph showing the convergence of a Fourier series to a periodic square-like wave function  f(x) . The x-axis is labeled with  -\pi  and  \pi . The y-axis is labeled  f(x) . A green horizontal line represents the target function. A smooth blue curve represents the approximation 'up to  n=1 ', which is a simple sine wave. A more complex black oscillating curve represents the approximation 'up to higher  n ', showing how adding more terms creates a wave that more closely follows the square shape of the target function, though with some overshoot (Gibbs phenomenon) at the discontinuities.
Visual representation of Fourier series convergence for increasing values of \( n \).
PAGE 3

Fourier Series Example: Piecewise Function

Another one:

\[ f(x) = \begin{cases} 0 & -\pi < x < 0 \\ \pi - x & 0 < x < \pi \end{cases} \quad \text{period } 2\pi \]

A Cartesian coordinate system showing a periodic sawtooth-like function f(x). The x-axis is labeled with multiples of pi: -2 pi, -pi, pi, 2 pi, 3 pi. The y-axis is labeled with pi. The function f(x) is zero on the intervals [-pi, 0] and [pi, 2 pi]. On the interval [0, pi], the function is a straight line starting at (0, pi) and ending at (pi, 0). This pattern repeats periodically.
Graph of the periodic function \( f(x) \)

Fourier Coefficients

\[ a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos(nx) \, dx \]

Calculate \( a_0 \) separately:

\[ a_0 = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \, dx = \frac{1}{\pi} \left( \frac{1}{2} \cdot \pi \cdot \pi \right) = \frac{1}{2}\pi \]

Note: The integral represents the area under \( f(x) \).

Solving for \( a_n \)

\[ a_n = \frac{1}{\pi} \int_{0}^{\pi} (\pi - x) \cos(nx) \, dx \quad \text{by parts} \]

\( = \dots \)

\[ = \frac{1}{n^2\pi} (1 - \underbrace{\cos(n\pi)}_{(-1)^n}) = \frac{1}{n^2\pi} (1 - (-1)^n) \quad n = 1, 2, 3, \dots \]
PAGE 4

Fourier Series Calculation and Analysis

Calculating the Fourier coefficient \(b_n\) using integration by parts:

\[b_n = \frac{1}{\pi} \int_{0}^{\pi} (\pi - x) \sin(nx) dx \quad \text{by parts}\]
\[= \dots = \frac{1}{n} \quad n=1, 2, 3, \dots\]

Fourier Series Expansion

The resulting Fourier series representation for \(f(x)\) is:

\[f(x) \sim \frac{1}{2} \left( \frac{\pi}{2} \right) + \sum_{n=1}^{\infty} \left[ \frac{1}{n^2 \pi} (1 - (-1)^n) \cos(nx) + \frac{1}{n} \sin(nx) \right]\]

Expanding the first few terms of the series:

\[\sim \frac{\pi}{4} + \underbrace{\frac{2}{\pi} \cos(x) + \sin(x)}_{n=1} + \underbrace{\frac{1}{2} \sin(2x)}_{n=2} + \underbrace{\frac{2}{9\pi} \cos(3x) + \frac{1}{3} \sin(3x)}_{n=3} + \dots\]

Visual Representation

A Cartesian coordinate system showing the function f(x) and its Fourier series approximations. The x-axis is labeled with -\pi and \pi. A green curve represents a 'low order' approximation which is smooth and sinusoidal. A dark blue jagged curve represents a 'higher order' approximation that more closely follows a periodic sawtooth-like function. The higher order curve shows significant oscillations (Gibbs phenomenon) near the points of discontinuity at -\pi, 0, and \pi.
Figure 1: Comparison of low-order and higher-order Fourier approximations showing convergence and the Gibbs phenomenon.

Fourier Series Properties (discussed further later)

  • Notice the overshoot right before and after discontinuities (doesn't go away even when \(n\) increases).
  • Also, Fourier series seems to cut through the middle at discontinuities.
PAGE 5

Fourier Series Example: Absolute Value Function

One more example: \( f(x) = |x| \) for \( -\pi < x < \pi \) with a period of \( 2\pi \).

A graph of a periodic triangular wave function f(x) = |x|. The x-axis is labeled with multiples of pi: -3pi, -2pi, -pi, 0, pi, 2pi, 3pi. The y-axis is labeled f(x) and has a mark at pi. The function consists of a series of V-shapes, with minima at even multiples of pi (..., -2pi, 0, 2pi, ...) and maxima at odd multiples of pi (..., -3pi, -pi, pi, 3pi, ...). The peaks reach a height of pi.
Figure 1: Periodic extension of the absolute value function.

The function is defined piecewise on the interval \( [-\pi, \pi] \) as:

\[ f(x) = \begin{cases} -x & -\pi < x < 0 \\ x & 0 < x < \pi \end{cases} \]

Calculating Fourier Coefficients

First, we calculate the constant term \( a_0 \):

\[ a_0 = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \, dx = \frac{1}{\pi} \left( \frac{1}{2} \cdot 2\pi \cdot \pi \right) = \pi \]

Next, we find the cosine coefficients \( a_n \):

\[ a_n = \dots = \frac{2}{\pi n^2} ((-1)^n - 1) \]

Finally, the sine coefficients \( b_n \) are zero because the function is even:

\[ b_n = \dots = 0 \]