About

Half Range Expansion

Theory

If a function f(x)f(x) is defined only on a half-period [0,L][0,L], it can be extended to [−L,L][-L,L] as:

Exercises

Exercise 1

Write the half-range Fourier sine series expansion for

f(x)={0,0≤x≤π2,1,π2≤x≤π.f(x)= \begin{cases} 0, & 0\le x\le \frac{\pi}{2},\\ 1, & \frac{\pi}{2}\le x\le \pi. \end{cases}
Show solution ↓
Solution

For a half-range sine series on [0,π][0,\pi], we use

f(x)=∑n=1∞bnsin⁡(nx),f(x)=\sum_{n=1}^{\infty} b_n \sin(nx),

where

bn=2π∫0πf(x)sin⁡(nx) dx.b_n=\frac{2}{\pi}\int_{0}^{\pi}f(x)\sin(nx)\,dx.

Since f(x)=0f(x)=0 on [0,π2][0,\frac{\pi}{2}] and f(x)=1f(x)=1 on [π2,π][\frac{\pi}{2},\pi],

bn=2π∫π2πsin⁡(nx) dx.b_n=\frac{2}{\pi}\int_{\frac{\pi}{2}}^{\pi}\sin(nx)\,dx.bn=2π[−cos⁡(nx)n]π2π=2nπ(cos⁡nπ2−cos⁡nπ).b_n=\frac{2}{\pi}\left[-\frac{\cos(nx)}{n}\right]_{\frac{\pi}{2}}^{\pi} =\frac{2}{n\pi}\left(\cos\frac{n\pi}{2}-\cos n\pi\right).

Since cos⁡nπ=(−1)n\cos n\pi=(-1)^n, we obtain

bn=2nπ(cos⁡nπ2−(−1)n).b_n=\frac{2}{n\pi}\left(\cos\frac{n\pi}{2}-(-1)^n\right).

Hence, the half-range sine series is

f(x)=\sum_{n=1}^{\infty} \frac{2}{n\pi}\left(\cos\frac{n\pi}{2}-(-1)^n\right)\sin(nx), \quad 0<x<\pi.
Exercise 2

Write the half-range cosine series expansion of

f(x)=x,\quad 0<x<4.
Show solution ↓
Solution

For a half-range cosine series on [0,L][0,L] with L=4L=4,

f(x)=a02+∑n=1∞ancos⁡nπx4,f(x)=\frac{a_0}{2}+\sum_{n=1}^{\infty}a_n\cos\frac{n\pi x}{4},

where

a0=24∫04x dx,an=24∫04xcos⁡nπx4 dx.a_0=\frac{2}{4}\int_{0}^{4}x\,dx, \quad a_n=\frac{2}{4}\int_{0}^{4}x\cos\frac{n\pi x}{4}\,dx.

First,

a0=12[x22]04=4.a_0=\frac{1}{2}\left[\frac{x^2}{2}\right]_{0}^{4}=4.

Next, using integration by parts,

an=12∫04xcos⁡nπx4 dx=8(−1)nn2π2.a_n=\frac{1}{2}\int_{0}^{4}x\cos\frac{n\pi x}{4}\,dx =\frac{8(-1)^n}{n^2\pi^2}.

Thus, the half-range cosine series is

f(x)=2+\sum_{n=1}^{\infty}\frac{8(-1)^n}{n^2\pi^2} \cos\frac{n\pi x}{4}, \quad 0<x<4.