Question 2 of 7: Fourier Series of $x^2$ and of Its Derivative
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
National Examinations, December 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.
Given. $F(x)=x^2$ on $-2\pi\le x\le2\pi$, period $4\pi$ (half-period $L=2\pi$); $G(x)=x$ on the same interval and period.
Find. (a) The Fourier series of $F(x)$. (b) The Fourier series of $G(x)$, obtained from part (a) rather than re-integrated from scratch.
Approach. $F$ is even, so its series is a pure cosine series; compute $a_0,a_n$ directly. Since $F$ is continuous with a piecewise-smooth derivative and $F'(x)=2x=2G(x)$, differentiate the series of $F$ term by term and halve it to get the series of $G$ — far faster than integrating $G$'s own $b_n$ coefficients from scratch.
Set up the cosine series (F is even). With half-period $L=2\pi$,
$$a_0=\frac1L\int_{-L}^{L}F(x)\,dx=\frac{1}{2\pi}\int_{-2\pi}^{2\pi}x^2\,dx=\frac{1}{2\pi}\cdot\frac{2(2\pi)^3}{3}=\frac{8\pi^2}{3}\ \Rightarrow\ \frac{a_0}{2}=\frac{4\pi^2}{3}$$
Compute $a_n$ by parts (twice).
$$a_n=\frac2L\int_0^{L}x^2\cos\!\Big(\frac{n\pi x}{L}\Big)dx=\frac1\pi\int_0^{2\pi}x^2\cos\!\Big(\frac{nx}2\Big)dx$$
Two integrations by parts (standard $\int x^2\cos(kx)\,dx$ reduction, $k=n/2$) give, after substituting the limits and using $\cos(n\pi)=(-1)^n$, $\sin(n\pi)=0$:
$$\boxed{a_n=\dfrac{16(-1)^n}{n^2}},\qquad b_n=0\ \ (n=1,2,3,\dots)$$
Assemble $F(x)$.
$$\boxed{F(x)=x^2=\dfrac{4\pi^2}{3}+16\sum_{n=1}^{\infty}\dfrac{(-1)^n}{n^2}\cos\!\Big(\dfrac{nx}{2}\Big)}$$
Sanity check at $x=2\pi$ (where the periodic extension is continuous, $F(2\pi^-)=F(-2\pi^+)=4\pi^2$): the series must sum to $4\pi^2$ there, which is confirmed.
Differentiate term by term for $G$. $F$ is continuous everywhere (its periodic extension has no jumps, since $(2\pi)^2=(-2\pi)^2$) with a piecewise-continuous derivative, so termwise differentiation of its Fourier series is valid:
$$F'(x)=\frac{d}{dx}\!\left[\frac{4\pi^2}{3}+16\sum_{n=1}^{\infty}\frac{(-1)^n}{n^2}\cos\!\Big(\frac{nx}2\Big)\right]=16\sum_{n=1}^{\infty}\frac{(-1)^n}{n^2}\!\left(-\frac n2\right)\sin\!\Big(\frac{nx}2\Big)=-8\sum_{n=1}^{\infty}\frac{(-1)^n}{n}\sin\!\Big(\frac{nx}2\Big)$$
Solve for $G$. Since $F'(x)=2x=2G(x)$,
$$\boxed{G(x)=x=4\sum_{n=1}^{\infty}\dfrac{(-1)^{n+1}}{n}\sin\!\Big(\dfrac{nx}{2}\Big)}$$
Numerically at $x=1.3$ the first $4000$ terms of this series sum to $1.2995$, matching $G(1.3)=1.3$ to the truncation error expected of a slowly-converging (conditionally convergent) sine series.