MA 30300: Differential Equations

9.3. Fourier Sine and Cosine Series

Goal: Understand odd/even extensions, Fourier sine/cosine series, and endpoint value problems.


In practice, if a function \(f(t)\) is defined on the interval \(0 < t < L\), there are two natural ways to extend it to the whole real line: as an even function or as an odd function.

The even \(2L\)-periodic extension of \(f\) is the function \(f_E(t)\) defined by:

\[ f_E(t) = \begin{cases} f(t), & 0 < t < L, \\[1mm] f(-t), & -L < t < 0, \end{cases} \]

and then extended periodically by:

\[ f_E(t + 2L) = f_E(t), \quad \text{for all } t \in \mathbb{R}. \]

The odd \(2L\)-periodic extension of \(f\) is the function \(f_O(t)\) defined by:

\[ f_O(t) = \begin{cases} f(t), & 0 < t < L, \\[1mm] -f(-t), & -L < t < 0, \end{cases} \]

and extended periodically by:

\[ f_O(t + 2L) = f_O(t), \quad \text{for all } t \in \mathbb{R}. \]

These constructions allow us to represent \(f(t)\) as a Fourier series—sine series in the odd extension case and cosine series in the even extension case—over the interval \([0,L]\).

Example 1.1: \(f(x) = x\) on \([0,2]\)

  • Construct the odd \(2L\)-periodic extension of \(f(x)\) to the whole real line (here \(L=2\)).
  • Sketch one full period of the extended function.

Example 1.2: \(f(x) = x^2\) on \([0,2]\)

  • Construct the even \(2L\)-periodic extension of \(f(x)\) to the whole real line (here \(L=2\)).
  • Sketch one full period of the extended function.

Example 1.3: \(f(x) = 3\) on \([0,\pi]\)

  • Construct the odd \((2\pi)\)-periodic extension of \(f(x)\) to the whole real line.
  • Sketch one full period of the extended function.

Example 1.4: \(f(x) = x\) on \([0,\pi]\)

  • Construct the odd \((2\pi)\)-periodic extension of \(f(x)\) to the whole real line.
  • Sketch one full period of the extended function.

Example 1.5: \(f(x) = e^x\) on \([0,\pi]\)

Choose the even \(2\pi\)-periodic extension of \(f(x)\) to \([- \pi,0]\):

  1. (A) \(f(x) = e^{-x}\)
  2. (B) \(f(x) = -e^x\)
  3. (C) \(f(x) = e^x\)
  4. (D) \(f(x) = -e^{-x}\)

Example 1.6 \(f(x) = \cos(\pi t) \) on \([0,1]\)

Let \( f(t) = \cos(\pi t) \), defined for \( 0 < t < 1 \). Extend \( f(t) \) as an odd function on \([-1,1]\).

Choose the correct expression for \( f_O(t) \):

  1. \[ f_O(t) = \begin{cases} \cos(\pi t), & -1 < t < 0\\ \cos(\pi t), & 0 < t < 1 \end{cases} \]
  2. \[ f_O(t) = \begin{cases} -\cos(\pi t), & -1 < t < 0\\ \cos(\pi t), & 0 < t < 1 \end{cases} \]
  3. \[ f_O(t) = \begin{cases} \cos(-\pi t), & -1 < t < 0\\ \cos(\pi t), & 0 < t < 1 \end{cases} \]
  4. \[ f_O(t) = \begin{cases} \sin(\pi t), & -1 < t < 0\\ \cos(\pi t), & 0 < t < 1 \end{cases} \]

If a function \(f(x)\) is defined on the interval \([0,L]\), the Fourier Sine Series of \(f\) is given by:

\[ f(x) \sim \sum_{n=1}^{\infty} b_n \, \sin\left(\frac{n \pi x}{L}\right), \quad \text{where} \quad b_n = \frac{2}{L} \int_0^L f(x) \, \sin\left(\frac{n \pi x}{L}\right) dx. \]

This formula represents the odd \(2L\)-periodic extension of \(f(x)\) over the whole real line. Only sine terms appear because the extended function is odd.

Example 2.1:

\[ f(x) = x, \quad 0 < x < 2 \]

Find the Fourier sine series of \(f(x)\) on \([0,2]\).

Example 2.2:

\[ f(x) = x(2-x), \quad 0 < x < 2 \]

Find the Fourier sine series of \(f(x)\) on \([0,2]\).

Example 2.3:

\[ f(x) = \begin{cases} 1, & 0 < x < 1, \\[1mm] -1, & 1 < x < 2 \end{cases} \]

Find the Fourier sine series of \(f(x)\) on \([0,2]\).

Example 2.4:

\[ f(x) = 1, \quad 0 < x < 2 \]

Find the Fourier sine series of \(f(x)\) on \([0,2]\).

Example 2.5:

Calculate the first coefficient, \( b_1 \), of the Fourier Sine Series for the function \( f(t) = \cos(\pi t) \) on the interval \([0, 1]\).

  1. \[ b_1 = \frac{1}{\pi} \]
  2. \[ b_1 = \frac{2}{\pi} \]
  3. \[ b_1 = 0 \]
  4. \[ b_1 = 1 \]

If a function \(f(x)\) is defined on the interval \([0,L]\), the Fourier Cosine Series of \(f\) is given by:

\[ f(x) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n \, \cos\left(\frac{n \pi x}{L}\right), \quad \text{where} \quad a_0 = \frac{2}{L} \int_0^L f(x) \, dx, \quad a_n = \frac{2}{L} \int_0^L f(x) \, \cos\left(\frac{n \pi x}{L}\right) dx. \]

This formula represents the even \(2L\)-periodic extension of \(f(x)\) over the whole real line. Only cosine terms appear because the extended function is even.

Example 3.1:

\[ f(x) = x, \quad 0 < x < 2 \]

Find the Fourier cosine series of \(f(x)\) on \([0,2]\).

Example 3.2:

\[ f(x) = x^2, \quad 0 < x < 2 \]

Find the Fourier cosine series of \(f(x)\) on \([0,2]\).

Example 3.3:

\[ f(x) = \cos(x), \quad 0 < x < \pi \]

Find the Fourier cosine series of \(f(x)\) on \([0,\pi]\).

Example 3.4:

\[ f(x) = e^x, \quad 0 < x < \pi \]

Find the Fourier cosine series of \(f(x)\) on \([0,\pi]\).

Consider

\[ a x'' + b x' + c x = f(t), \quad 0< t < L, \]
with endpoint conditions.

Note: Check endpoint conditions

  • \( x(0)=x(L)=0 \) (Dirichlet) → use a sine series
  • \( x'(0)=x'(L)=0 \) (Neumann) → use a cosine series

Dirichlet Conditions: \(x(0) = x(L) = 0\)

Example 4.1

Find a formal Fourier series solution of the endpoint value problem:

\[ x'' + 2x = 1, \quad x(0) = x(\pi) = 0 \]

Example 4.2

Find a formal Fourier series solution of the endpoint value problem:

\[ x'' - 4x = 1, \quad x(0) = x(\pi) = 0 \]

Example 4.3

Find a formal Fourier series solution of the endpoint value problem:

\[ x'' + x = t, \quad x(0) = x(1) = 0 \]

Example 4.4

Find a formal Fourier series solution of the endpoint value problem:

\[ x'' + 2x = t, \quad x(0) = x(2) = 0 \]

Neumann Conditions: \(x'(0) = x'(L) = 0\)

Example 4.5

Find a formal Fourier series solution of the endpoint value problem:

\[ x'' + 2x = t, \quad x'(0) = x'(\pi) = 0 \]

Example 4.6

Find a formal Fourier series solution of the endpoint value problem:

\[ x'' + 4x = 4t, \quad x'(0) = x'(1) = 0 \]

Example 4.7

Find a formal Fourier series solution of the endpoint value problem:

\[ x'' - x = t, \quad x'(0) = x'(2) = 0 \]

Example 4.8

Find a formal Fourier series solution of the endpoint value problem:

\[ x'' + x = t^2, \quad x'(0) = x'(\pi) = 0 \]

Consider

\[ x'' + 2x = t, \quad x'(0) = x'(2) = 0. \]
  1. Let \(f(t) = t\) on \(0 \le t \le 2\). In order to solve the endpoint value problem, choose an appropriate extension of \(f(t)\) (even or odd) based on the endpoint conditions. Determine whether the resulting Fourier series will involve sine or cosine terms, and compute the corresponding Fourier series.
  2. Find a formal Fourier series solution of the the endpoint value problem.

Solution:

Part 1:

We are given \(f(t) = t\) on \(0 \le t \le 2\) with endpoint conditions \(x'(0)=x'(2)=0\). Since the derivative vanishes at the endpoints, we use an even extension of \(f(t)\) to \([-2,2]\), which leads to a cosine Fourier series:

\[ f(t) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n \cos\left(\frac{n \pi t}{2}\right) \]

with coefficients:

\[ a_0 = \frac{2}{L} \int_0^L f(t) \, dt = \frac{2}{2} \int_0^2 t \, dt = 2, \]
\[ a_n = \frac{2}{L} \int_0^L f(t) \cos\left(\frac{n \pi t}{L}\right) dt = \int_0^2 t \cos\left(\frac{n \pi t}{2}\right) dt \]

Compute \(a_n\) using integration by parts:

\[ \int_0^2 t \cos\left(\frac{n \pi t}{2}\right) dt = \frac{2 t}{n \pi} \sin\left(\frac{n \pi t}{2}\right)\Big|_0^2 + \frac{4}{(n\pi)^2} \cos\left(\frac{n \pi t}{2}\right)\Big|_0^2 = \frac{4}{(n \pi)^2} \left[(-1)^n - 1\right]. \]
\[ a_n = \begin{cases} -\dfrac{8}{(n \pi)^2}, & n \text{ odd} \\ 0, & n \text{ even} \end{cases} \]

Hence, the Fourier cosine series is:

\[ f(t) = t \sim 1 - \sum_{n \text{ odd}} \frac{8}{(n \pi)^2} \cos\left(\frac{n \pi t}{2}\right) \]

Part 2:

Assume a solution in the form of a Fourier cosine series. Since the even terms (for \(n \ge 2\)) of the forcing function are zero, we only need to include the constant term and the odd harmonics:

\[ x(t) = \frac{X_0}{2} + \sum_{n \text{ odd}} X_n \cos\left(\frac{n \pi t}{2}\right) \]

The second derivative of this assumed solution is:

\[ x''(t) = \sum_{n \text{ odd}} -X_n \left(\frac{n \pi}{2}\right)^2 \cos\left(\frac{n \pi t}{2}\right) \]

Substituting \(x(t)\) and \(x''(t)\) into the differential equation \(x'' + 2x = f(t)\):

\[ X_0 + \sum_{n \text{ odd}} \left[ 2 - \left(\frac{n\pi}{2}\right)^2 \right] X_n \cos\left(\frac{n\pi t}{2}\right) = 1 - \sum_{n \text{ odd}} \frac{8}{(n \pi)^2} \cos\left(\frac{n \pi t}{2}\right) \]

By matching the constant term and the coefficients for each odd \(n\):

Constant term (\(n=0\)):

\[ X_0 = 1 \]

Odd terms (\(n = 1, 3, 5, \dots\)):

\[ \left[ 2 - \frac{n^2 \pi^2}{4} \right] X_n = -\frac{8}{n^2 \pi^2} \]
Since \( n \) is an integer, the term \( 2 - \dfrac{n^2 \pi^2}{4} \) is never zero (as \( n^2 \pi^2 = 8 \) has no integer solutions). Thus, we can safely divide:
\[ X_n = \frac{32}{n^2 \pi^2 (n^2 \pi^2 - 8)} \]

The final formal Fourier series solution is:

\[ x(t) = \frac{1}{2} + \sum_{n \text{ odd}} \frac{32}{n^2 \pi^2 (n^2 \pi^2 - 8)} \cos\left(\frac{n \pi t}{2}\right). \]