Fouries Series


This is a tutorial made solely for the purpose of education and it was designed for students taking Applied Math 0340. It is primarily for students who have some experience using Mathematica. If you have never used Mathematica before and would like to learn more of the basics for this computer algebra system, it is strongly recommended looking at the APMA 0330 tutorial. As a friendly reminder, don'r forget to clear variables in use and/or the kernel.

Finally, the commands in this tutorial are all written in bold black font, while Mathematica output is in regular fonts. This means that you can copy and paste all commands into Mathematica, change the parameters and run them. You, as the user, are free to use the scripts to your needs for learning how to use the Mathematica program, and have the right to distribute this tutorial and refer to this tutorial as long as this tutorial is accredited appropriately.

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the course APMA0340
Return to the main page for the course APMA0330
Return to Part VI of the course APMA0340

 

Examples of Fourier Series


This section is a collection of Fourier series expansions for different functions.

Theorem: If a periodic function of period \( 2\ell \) is square-integrable on any finite interval, then the Fourier series converges to the function at almost every point:

\[ f(x) \,\sim \, \frac{a_0}{2} + \sum_{k\ge 0} \left[ a_k \cos \frac{k \pi x}{\ell} + b_k \sin \frac{k \pi x}{\ell} \right] , \]
where its coefficients are determined via Euler--Fourier formulas:
\[ \begin{split} a_k &= \frac{1}{\ell} \, \int_{-\ell}^{\ell} f(x)\,\cos \frac{k \pi x}{\ell} \, {\text d} x , \quad k=0,1,2,\ldots , \\ b_k &= \frac{1}{\ell} \, \int_{-\ell}^{\ell} f(x)\,\sin \frac{k \pi x}{\ell} \, {\text d} x , \quad k=1,2,\ldots . \end{split} \qquad\qquad ■ \]

Some example:

\[ \sum_{n\ge 1} \frac{(-1)^{n+1}}{2n-1} \, \cos (2n-1) x = \begin{cases} \frac{\pi}{4} , & \ \mbox{for } |x|< \frac{\pi}{2} , \\ -\frac{\pi}{4} , & \ \mbox{for } |x|> \frac{\pi}{2} , \end{cases} \qquad \mbox{on interval } \ -\pi < x < \pi . \]
\[ \sum_{n\ge 1} \frac{(-1)^{n+1}}{2n-1} \, \sin (2n-1) x = \frac{x}{2} , \qquad \mbox{on interval } \ -\pi < x < \pi . \]
\[ e^x = \frac{2\,\sinh \pi}{\pi} \left[ \frac{1}{2} + \sum_{n\ge 0} \frac{(-1)^n}{1+n^2} \left( \cos nx -n\,\sin nx \right) \right] , \qquad \mbox{on interval } \ |x|< \pi . \]
\[ \sin x = \frac{2}{\pi} - \frac{4}{\pi} \,\sum_{n\ge 1} \frac{1}{4n^2 -1} \, \cos 2nx , \qquad \mbox{on interval } \ 0\le x < \pi . \]
\[ \sum_{n\ge 1} \frac{1}{2n-1} \, \cos (2n-1) x = \frac{1}{2}\,\ln \cot \frac{x}{2} \qquad \mbox{on interval } \ 0 < x < \pi . \]
\[ \sum_{n\ge 1} \frac{1}{2n-1} \, \sin (2n-1) x = \frac{\pi}{4} \times \begin{cases} 1 , & \ \mbox{for } 0< x , \\ - 1 , & \ \mbox{for } x<0 , \end{cases} \qquad \mbox{on interval } \ -\pi < x < \pi . \]
\[ \frac{4}{\pi}\,\sum_{n\ge 1} \frac{1}{2n-1} \, \sin \frac{(2n-1)\pi x}{\ell} = 2 \left[ H\left( \frac{x}{\ell} \right) - H\left( \frac{x}{\ell} -1 \right) \right] -1 . \]
\[ \sum_{n\ge 1} \frac{1}{n} \, \cos n x = -\frac{1}{2} \, \ln \left[ 2 \left( 1 - \cos x \right) \right] , \qquad \mbox{on interval } \ 0 < x < 2\pi ; \]
\[ \sum_{n\ge 1} \frac{1}{n} \, \sin n x = \begin{cases} \frac{\pi -x}{2} , & \ \mbox{for } 0< x , \\ - \frac{\pi +x}{2} , & \ \mbox{for } x<0 , \end{cases} \qquad \mbox{on interval } \ -\pi < x < \pi . \]
\[ \sum_{n\ge 1} \frac{1}{n} \, \sin \frac{n\pi x}{\ell} = \frac{\ell-x}{2\ell} . \]
\[ \begin{split} \sum_{n\ge 1} \frac{(-1)^{n+1}}{n} \, \cos n x &= \ln \left( 2 \, \cos \frac{x}{2} \right) , \qquad \mbox{on interval } \ |x| < \pi ; \\ \sum_{n\ge 1} \frac{(-1)^{n+1}}{n} \, \sin n x &= \frac{x}{2} , \qquad \mbox{on interval } \ |x| < \pi . \end{split} \]
\[ \begin{split} \frac{\pi^2}{12} + \sum_{n\ge 1} \frac{(-1)^{n+1}}{n^2} \, \cos n x &= x^2 , \qquad \mbox{on interval } \ |x| < \pi ; \\ \sum_{n\ge 1} \frac{(-1)^{n+1}}{n^2} \, \sin n x &= ?? , \qquad \mbox{on interval } \ |x| < \pi . \end{split} \]
\[ \begin{split} \frac{\pi^2}{16} + \sum_{n\ge 1} \frac{1}{n^2} \, \cos n x &= \frac{x^2}{4} - \frac{\pi x}{4} , \qquad \mbox{on interval } \ 0< x < < 2\pi ; \\ \sum_{n\ge 1} \frac{1}{n^2} \, \sin n x &= ?? , \qquad \mbox{on interval } \ |x| < \pi . \end{split} \]
\[ \begin{split} \sum_{n\ge 1} \frac{1}{(2n-1)^2} \, \cos (2n-1) x &= \frac{1}{2} - \frac{\pi |x|}{4} , \qquad \mbox{on interval } \ |x|< < \pi ; \\ \sum_{n\ge 1} \frac{1}{(2n-1)^2} \, \sin (2n-1) x &= ?? , \qquad \mbox{on interval } \ |x| < \pi . \end{split} \]
\[ \begin{split} \sum_{n\ge 1} \frac{1}{n^3} \, \cos n x &= ?? , \qquad \mbox{on interval } \ 0< x < < 2\pi ; \\ \sum_{n\ge 1} \frac{1}{n^3} \, \sin n x &= \frac{\pi^2 x}{6} - \frac{\pi x^2}{4} + \frac{x^3}{12} , \qquad \mbox{on interval } \ 0 < x < 2\pi . \end{split} \]

 

 

Cesaro Approximation

Gibbs Phenomenon

Even and Odd Functions

Chebyshev expantion

Legendre expansion

Bessel--Fourier Series

Hermite Expansion

Laguerre Expansion

Motivated examples