NivaarExam PrepOfficial exam papers ↗

04-BS-5 · December 2017

Question 2 of 7: Fourier Series of a Piecewise-Quadratic Function

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

Notes on this paper

National Examinations, December 2017 — 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. 11 (Sturm–Liouville Problems, Fourier Series, Fourier Integrals and Transforms), Ch. 19 (Numerics in General: interpolation, numerical differentiation, Romberg integration, iterative equation solving), Ch. 20 (Numeric Linear Algebra: LU/Crout 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 (LU factorization).

Question 2: Fourier Series of a Piecewise-Quadratic Function (A: 14 marks; B: 6 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)$ has period $2\pi$, equal to $x(\pi+x)$ on $(-\pi,0)$ and $x(\pi-x)$ on $[0,\pi)$.

Find. (A) The full Fourier series of $f(x)$, with a sketch. (B) A proof that $\pi^3/32=\sum_{n=1}^{\infty}(-1)^{n-1}/(2n-1)^3$, using the part (A) result.

Approach. Show $f$ is odd (so only sine terms survive), integrate by parts twice to get a closed-form $b_n$, assemble the series, then evaluate the series at the continuity point $x=\pi/2$ to harvest the numerical identity.

  1. Test symmetry. For $0\lt x\lt\pi$, $-x\in(-\pi,0)$ and $f(-x)=(-x)(\pi-x)=-x(\pi-x)$… more directly, using the given branch on $(-\pi,0)$ with argument $-x$: $f(-x)=(-x)(\pi+(-x))=-x(\pi-x)=-f(x)$. So $f$ is odd: $a_0=0$ and $a_n=0$ for all $n$; only sine terms appear.
  2. Set up the sine-coefficient integral. For an odd, $2\pi$-periodic function, $$b_n=\dfrac{2}{\pi}\int_0^{\pi}f(x)\sin(nx)\,dx=\dfrac{2}{\pi}\int_0^{\pi}(\pi x-x^2)\sin(nx)\,dx$$
  3. Integrate by parts twice. Splitting $\int_0^\pi \pi x\sin(nx)\,dx-\int_0^\pi x^2\sin(nx)\,dx$ and applying integration by parts (first with $u=x$, then $u=x^2$) and using $\sin(n\pi)=0,\ \cos(n\pi)=(-1)^n$ term by term gives, after simplification, $$b_n=\dfrac{4}{\pi n^3}\big[1-(-1)^n\big]$$
  4. Collapse to the closed form. $1-(-1)^n$ is $2$ for odd $n$ and $0$ for even $n$, so $$\boxed{b_n=\begin{cases}\dfrac{8}{\pi n^3} & n \text{ odd}\\[4pt] 0 & n \text{ even}\end{cases}}$$
  5. Assemble the series. Writing the odd indices as $n=2k-1$, $$\boxed{f(x)=\dfrac{8}{\pi}\sum_{k=1}^{\infty}\dfrac{\sin\big((2k-1)x\big)}{(2k-1)^{3}}}$$ The sketch (figure below) shows the odd, $2\pi$-periodic parabolic-arch wave: zero at $x=0,\pm\pi,\pm2\pi,\dots$, rising to a maximum of $f(\pi/2)=\pi^2/4\approx2.467$ at $x=\pi/2$ (and the mirror-image minimum at $x=-\pi/2$).
  6. Part (B): evaluate the series at $x=\pi/2$, a point of continuity. By Dirichlet's theorem the series converges to $f(\pi/2)$ itself there. Directly, $f(\pi/2)=\tfrac{\pi}{2}\big(\pi-\tfrac{\pi}{2}\big)=\dfrac{\pi^2}{4}$. On the series side, $\sin\!\big((2k-1)\tfrac{\pi}{2}\big)=(-1)^{k-1}$ (the values $\sin(\pi/2),\sin(3\pi/2),\sin(5\pi/2),\dots=1,-1,1,\dots$), so $$\dfrac{\pi^2}{4}=\dfrac{8}{\pi}\sum_{k=1}^{\infty}\dfrac{(-1)^{k-1}}{(2k-1)^3}$$
  7. Solve for the sum. Multiplying both sides by $\pi/8$, $$\boxed{\sum_{n=1}^{\infty}\dfrac{(-1)^{n-1}}{(2n-1)^3}=\dfrac{\pi^2}{4}\cdot\dfrac{\pi}{8}=\dfrac{\pi^3}{32}}$$ as required. A numerical partial sum over the first $2\times10^5$ terms gives $0.968946146$, matching $\pi^3/32=0.968946146\ldots$ to nine digits.
-6.28-3.1403.146.28-202f(x), period 2pi (odd, sine series)x (rad)f(x)
Figure: $f(x)$ sketched over $[-2\pi,2\pi]$ — odd, period $2\pi$, peak $\pi^2/4$ at $x=\pi/2+2k\pi$.
QuantityResult
SymmetryOdd function $\Rightarrow a_0=a_n=0$
$b_n$$8/(\pi n^3)$ for odd $n$, $0$ for even $n$
Fourier series$f(x)=\dfrac{8}{\pi}\displaystyle\sum_{k=1}^{\infty}\dfrac{\sin((2k-1)x)}{(2k-1)^3}$
Identity proved$\displaystyle\sum_{n=1}^{\infty}\dfrac{(-1)^{n-1}}{(2n-1)^3}=\dfrac{\pi^3}{32}\approx0.968946$