NivaarExam PrepOfficial exam papers ↗

04-BS-5 · May 2018

Question 2 of 7: Fourier Series of a Piecewise-Linear Tent Function

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

National Examinations, May 2018 — 04-BS-5 Advanced Mathematics, 3 hours, closed book (approved Casio/Sharp calculator and one double-sided aid sheet permitted). Any five of the seven questions constitute a complete paper and all questions are of equal value; all seven are answered below as a full study resource.

Reference texts: Kreyszig, Advanced Engineering Mathematics, 10th ed. (Wiley) — Ch. 5 (Series Solutions of ODEs about an ordinary point), Ch. 11 (Fourier Series, Fourier Integrals and Transforms), Ch. 19 (Numerics in General: interpolation, numerical differentiation, Romberg integration, iterative equation solving), Ch. 20 (Numeric Linear Algebra: Cholesky/LU factorization). Supporting: Chapra & Canale, Numerical Methods for Engineers, 7th ed. — Ch. 5–6 (bracketing and open root-finding methods), Ch. 18 (interpolation), Ch. 22 (Romberg integration); Strang, Introduction to Linear Algebra, 6th ed. — Ch. 2 (Cholesky/LU factorization).

Question 2: Fourier Series of a Piecewise-Linear Tent Function (20 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Given. $f(x)$, period $2\pi$: a trapezoidal "tent" — flat at height $\pi/2$ on the outer bands $\pi/2\le|x|\lt\pi$, rising linearly to a peak of $\pi$ at $x=0$ over $|x|\lt\pi/2$.

Find. The full Fourier series $f(x)=\tfrac{a_0}{2}+\sum_{n=1}^\infty\big[a_n\cos(nx)+b_n\sin(nx)\big]$.

Approach. Test symmetry first (an even function needs only cosine terms and halves the work); then compute $a_0$ and $a_n$ by splitting the integral over $[0,\pi]$ at the corner $x=\pi/2$.

  1. Test symmetry. For $0\lt x\lt\pi/2$: $-x\in(-\pi/2,0)$, and on that branch $f(-x)=(-x)+\pi=\pi-x=f(x)$. For $\pi/2\le x\lt\pi$: $-x\in(-\pi,-\pi/2]$, and $f(-x)=\pi/2=f(x)$. So $\boxed{f(-x)=f(x)}$ everywhere: $f$ is even, hence $b_n=0$ for every $n$ and only cosine terms survive.
  2. Compute $a_0$. For an even function, $a_0=\dfrac{2}{\pi}\displaystyle\int_0^{\pi}f(x)\,dx=\dfrac{2}{\pi}\left[\int_0^{\pi/2}(\pi-x)\,dx+\int_{\pi/2}^{\pi}\dfrac{\pi}{2}\,dx\right]$. The first piece is $\big[\pi x-\tfrac{x^2}{2}\big]_0^{\pi/2}=\tfrac{\pi^2}{2}-\tfrac{\pi^2}{8}=\tfrac{3\pi^2}{8}$; the second is $\tfrac{\pi}{2}\cdot\tfrac{\pi}{2}=\tfrac{\pi^2}{4}$. So $$a_0=\dfrac{2}{\pi}\left(\dfrac{3\pi^2}{8}+\dfrac{\pi^2}{4}\right)=\dfrac{2}{\pi}\cdot\dfrac{5\pi^2}{8}=\dfrac{5\pi}{4}\quad\Rightarrow\quad\boxed{\dfrac{a_0}{2}=\dfrac{5\pi}{8}}$$
  3. Compute $a_n$. $$a_n=\dfrac{2}{\pi}\left[\int_0^{\pi/2}(\pi-x)\cos(nx)\,dx+\int_{\pi/2}^{\pi}\dfrac{\pi}{2}\cos(nx)\,dx\right]$$ Integrating the first piece by parts (once, since it is linear in $x$) and the second piece directly, then combining over a common denominator, collapses to the closed form $$a_n=\dfrac{2\big[1-\cos(n\pi/2)\big]}{\pi n^2}$$
  4. Evaluate the cosine pattern. $\cos(n\pi/2)$ cycles $1,0,-1,0$ for $n\equiv0,1,2,3\pmod4$, so $$\boxed{a_n=\begin{cases}0 & n\equiv0\pmod4\\ \dfrac{2}{\pi n^2} & n\text{ odd}\\ \dfrac{4}{\pi n^2} & n\equiv2\pmod4\end{cases}}$$ (numerically $a_1=2/\pi,\ a_2=1/\pi,\ a_3=2/9\pi,\ a_4=0,\ a_5=2/25\pi,\ a_6=1/9\pi,\ a_7=2/49\pi,\ a_8=0$.)
  5. Assemble the series. $$\boxed{f(x)=\dfrac{5\pi}{8}+\sum_{k=0}^{\infty}\dfrac{2}{\pi(2k+1)^2}\cos\big((2k+1)x\big)+\sum_{k=0}^{\infty}\dfrac{4}{\pi(4k+2)^2}\cos\big((4k+2)x\big)}$$ The sketch below confirms the even trapezoidal tent, peaking at $\pi\approx3.1416$ at $x=0$ and settling at the plateau $\pi/2\approx1.5708$ over $\pi/2\le|x|\lt\pi$, repeating with period $2\pi$.
-6.28-3.77-1.261.263.776.281.571.882.22.512.833.14f(x)f(x): even tent wave, period 2πx (rad)f(x)
Figure: $f(x)$ sketched over $[-2\pi,2\pi]$ — even, period $2\pi$, trapezoidal tent peaking at $\pi$.
QuantityResult
SymmetryEven $\Rightarrow b_n=0$
$a_0/2$$5\pi/8\approx1.9635$
$a_n$, $n$ odd$2/(\pi n^2)$
$a_n$, $n\equiv2\ (\mathrm{mod}\ 4)$$4/(\pi n^2)$
$a_n$, $n\equiv0\ (\mathrm{mod}\ 4)$$0$