Skip to content

Fourier Series

A Fourier series of a 2π2\pi-periodic function ff is

f(x)∼a02+∑n=1∞(ancos⁡(nx)+bnsin⁡(nx))f(x) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty} \left(a_n \cos(nx) + b_n \sin(nx)\right)

Where

an=1π∫−ππf(x)cos⁡(nx) dx,bn=1π∫−ππf(x)sin⁡(nx) dxa_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\cos(nx)\, dx, \quad b_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin(nx)\, dx

The Fourier coefficients are derived using the orthogonality relations on [−π,π][-\pi, \pi]:

∫−ππcos⁡(mx)cos⁡(nx) dx={πm=n≠02πm=n=00m≠n\int_{-\pi}^{\pi} \cos(mx)\cos(nx)\, dx = \begin{cases} \pi & m = n \neq 0 \\ 2\pi & m = n = 0 \\ 0 & m \neq n \end{cases}

∫−ππsin⁡(mx)sin⁡(nx) dx={πm=n≠00m≠n\int_{-\pi}^{\pi} \sin(mx)\sin(nx)\, dx = \begin{cases} \pi & m = n \neq 0 \\ 0 & m \neq n \end{cases}

∫−ππcos⁡(mx)sin⁡(nx) dx=0for  all  m,n\int_{-\pi}^{\pi} \cos(mx)\sin(nx)\, dx = 0 \quad \mathrm{for}\; all\; m, n

To find ana_nMultiply both sides of the Fourier expansion by cos⁡(nx)\cos(nx) and integrate over [−π,π][-\pi, \pi]. By orthogonality, all terms vanish except the cos⁡(nx)\cos(nx) term, yielding anπ=∫−ππf(x)cos⁡(nx) dxa_n \pi = \int_{-\pi}^{\pi} f(x)\cos(nx)\, dx. Similarly for bnb_n.

Theorem 7.1 (Dirichlet”s Theorem). If ff is 2π2\pi-periodic and piecewise smooth, its Fourier Series converges to:

  • f(x)f(x) at points where ff is continuous.
  • f(x+)+f(x−)2\frac{f(x^+) + f(x^-)}{2} at jump discontinuities.

1π∫−ππ∣f(x)∣2 dx=a022+∑n=1∞(an2+bn2)\frac{1}{\pi}\int_{-\pi}^{\pi} |f(x)|^2\, dx = \frac{a_0^2}{2} + \sum_{n=1}^{\infty}(a_n^2 + b_n^2)

Intuition. Parseval’s identity is the infinite-dimensional analogue of the Pythagorean theorem: The “energy” of ff (its L2L^2 norm squared) equals the sum of the energies of its Fourier Components.

For functions defined on [0,L][0, L]:

  • Cosine series (even extension): an=2L∫0Lf(x)cos⁡nπxL dxa_n = \frac{2}{L}\int_0^L f(x)\cos\frac{n\pi x}{L}\, dx bn=0b_n = 0.
  • Sine series (odd extension): an=0a_n = 0 bn=2L∫0Lf(x)sin⁡nπxL dxb_n = \frac{2}{L}\int_0^L f(x)\sin\frac{n\pi x}{L}\, dx.

Problem. Find the Fourier series of f(x)=xf(x) = x on (−π,π)(-\pi, \pi)Extended 2π2\pi-periodically.

Solution. ff is odd, so an=0a_n = 0 for all nn.

bn=1π∫−ππxsin⁡(nx) dx=2π∫0πxsin⁡(nx) dxb_n = \frac{1}{\pi}\int_{-\pi}^{\pi} x\sin(nx)\, dx = \frac{2}{\pi}\int_0^{\pi} x\sin(nx)\, dx.

Integration by parts: u=xu = x, dv=sin⁡(nx) dxdv = \sin(nx)\, dx:

bn=2π[−xcos⁡(nx)n∣0π+∫0πcos⁡(nx)n dx]=2π[−πcos⁡(nπ)n+0]=−2cos⁡(nπ)n=2(−1)n+1nb_n = \frac{2}{\pi}\left[-\frac{x\cos(nx)}{n}\Big|_0^{\pi} + \int_0^{\pi} \frac{\cos(nx)}{n}\, dx\right] = \frac{2}{\pi}\left[-\frac{\pi\cos(n\pi)}{n} + 0\right] = \frac{-2\cos(n\pi)}{n} = \frac{2(-1)^{n+1}}{n}.

x∼2∑n=1∞(−1)n+1nsin⁡(nx)x \sim 2\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n}\sin(nx). ■\blacksquare

Problem. Find the Fourier cosine series of f(x)=x2f(x) = x^2 on [0,π][0, \pi].

Solution

Solution. Extend ff as an even function on [−π,π][-\pi, \pi]. Then bn=0b_n = 0 for all nn.

a0=2π∫0πx2 dx=2π⋅π33=2π23a_0 = \frac{2}{\pi}\int_0^{\pi} x^2\, dx = \frac{2}{\pi} \cdot \frac{\pi^3}{3} = \frac{2\pi^2}{3}.

For n≥1n \geq 1: an=2π∫0πx2cos⁡(nx) dxa_n = \frac{2}{\pi}\int_0^{\pi} x^2\cos(nx)\, dx.

Integrating by parts twice:

u=x2u = x^2, dv=cos⁡(nx) dxdv = \cos(nx)\, dx: du=2x dxdu = 2x\, dx, v=sin⁡(nx)/nv = \sin(nx)/n.

an=2π[x2sin⁡(nx)n∣0π−∫0π2xsin⁡(nx)n dx]=−4nπ∫0πxsin⁡(nx) dxa_n = \frac{2}{\pi}\left[\frac{x^2\sin(nx)}{n}\Big|_0^{\pi} - \int_0^{\pi} \frac{2x\sin(nx)}{n}\, dx\right] = -\frac{4}{n\pi}\int_0^{\pi} x\sin(nx)\, dx

=−4nπ[−xcos⁡(nx)n∣0π+∫0πcos⁡(nx)n dx]= -\frac{4}{n\pi}\left[-\frac{x\cos(nx)}{n}\Big|_0^{\pi} + \int_0^{\pi} \frac{\cos(nx)}{n}\, dx\right]

=−4nπ[−πcos⁡(nπ)n+0]=4cos⁡(nπ)n2=4(−1)nn2= -\frac{4}{n\pi}\left[-\frac{\pi\cos(n\pi)}{n} + 0\right] = \frac{4\cos(n\pi)}{n^2} = \frac{4(-1)^n}{n^2}.

x2∼π23+4∑n=1∞(−1)nn2cos⁡(nx)x^2 \sim \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty} \frac{(-1)^n}{n^2}\cos(nx).

Setting x=0x = 0: 0=π23+4∑n=1∞(−1)nn20 = \frac{\pi^2}{3} + 4\sum_{n=1}^{\infty} \frac{(-1)^n}{n^2}Giving the famous identity ∑n=1∞(−1)n+1n2=π212\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n^2} = \frac{\pi^2}{12}. ■\blacksquare

Using Euler’s formula, the Fourier series can be written in complex form:

f(x)∼∑n=−∞∞cneinxf(x) \sim \sum_{n=-\infty}^{\infty} c_n e^{inx}

Where cn=12π∫−ππf(x)e−inx dxc_n = \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x)e^{-inx}\, dx.

The relationship with the real coefficients is c0=a0/2c_0 = a_0/2, cn=(an−ibn)/2c_n = (a_n - ib_n)/2 for n>0n > 0 And c−n=cn‾c_{-n} = \overline{c_n} when ff is real-valued.

Problem. Using the Fourier series of f(x)=xf(x) = x on (−π,π)(-\pi, \pi)Verify Parseval’s identity And deduce ∑n=1∞1n2=π26\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}.

Solution

Solution. From Section 7.6: a0=0a_0 = 0, an=0a_n = 0, bn=2(−1)n+1nb_n = \frac{2(-1)^{n+1}}{n}.

Parseval: 1π∫−ππx2 dx=∑n=1∞bn2=∑n=1∞4n2\frac{1}{\pi}\int_{-\pi}^{\pi} x^2\, dx = \sum_{n=1}^{\infty} b_n^2 = \sum_{n=1}^{\infty} \frac{4}{n^2}.

1π⋅2π33=4∑n=1∞1n2\frac{1}{\pi} \cdot \frac{2\pi^3}{3} = 4\sum_{n=1}^{\infty} \frac{1}{n^2}.

2π23=4∑n=1∞1n2\frac{2\pi^2}{3} = 4\sum_{n=1}^{\infty} \frac{1}{n^2}.

∑n=1∞1n2=π26\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}. ■\blacksquare

  • Confusing the a0/2a_0/2 convention with a0a_0; the factor of 1/21/2 ensures the formula for ana_n works for n=0n = 0.
  • Forgetting that the Fourier series of a function with jump discontinuities converges to the average of the left and right limits, not to the function value.
  • Mixing up sine and cosine series: a cosine series requires an even extension, while a sine series requires an odd extension.
  • Neglecting to check piecewise smoothness before applying Dirichlet’s theorem.
  • Assuming that term-by-term differentiation of a Fourier series is always valid; it requires the differentiated series to converge.
  • Confusing the complex Fourier coefficient cnc_n with the real coefficients ana_n and bnb_n.
ResultFormula / Statement
Fourier coefficientsan=1π∫−ππf(x)cos⁡(nx) dxa_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\cos(nx)\,dx
Convergence (Dirichlet)Converges to f(x)f(x) where continuous, average at jumps
Parseval’s identity$\frac{1}{\pi}\int_{-\pi}^{\pi}
Complex formcn=12π∫−ππf(x)e−inx dxc_n = \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x)e^{-inx}\,dx
Sine series (odd ext.)bn=2L∫0Lf(x)sin⁡nπxL dxb_n = \frac{2}{L}\int_0^L f(x)\sin\frac{n\pi x}{L}\,dx
Cosine series (even ext.)an=2L∫0Lf(x)cos⁡nπxL dxa_n = \frac{2}{L}\int_0^L f(x)\cos\frac{n\pi x}{L}\,dx