Fourier Series/Square of x minus pi, Square of pi

From ProofWiki
Jump to: navigation, search

Theorem

Let $f \left({x}\right)$ be the real function defined on $\left({0 \,.\,.\, 2 \pi}\right)$ as:

$f \left({x}\right) = \begin{cases} \left({x - \pi}\right)^2 & : 0 < x \le \pi \\ \pi^2 & : \pi < x < 2 \pi \end{cases}$


Then its Fourier series can be expressed as:

$f \left({x}\right) \sim \displaystyle \frac {2 \pi^2} 3 + \sum_{n \mathop = 1}^\infty \left({\frac {2 \cos n x} {n^2} + \left({\frac {\left({-1}\right)^n \pi} n + \frac {2 \left({\left({-1}\right)^n - 1}\right)} {\pi n^3} }\right) \sin n x}\right)$


Proof

By definition of Fourier series:

$\displaystyle f \left({x}\right) \sim \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty \left({a_n \cos n x + b_n \sin n x}\right)$

where:

\(\displaystyle a_n\) \(=\) \(\displaystyle \dfrac 1 \pi \int_0^{2 \pi} f \left({x}\right) \cos n x \rd x\)
\(\displaystyle b_n\) \(=\) \(\displaystyle \dfrac 1 \pi \int_0^{2 \pi} f \left({x}\right) \sin n x \rd x\)

for all $n \in \Z_{>0}$.


Thus:

\(\displaystyle a_0\) \(=\) \(\displaystyle \frac 1 \pi \int_0^{2 \pi} f \left({x}\right) \rd x\) Cosine of Zero is One
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \int_0^\pi \left({x - \pi}\right)^2 \rd x + \frac 1 \pi \int_\pi^{2 \pi} \pi^2 \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \int_0^\pi \left({x^2 + 2 \pi x - \pi^2}\right) \rd x + \frac 1 \pi \big[{\pi^2 x}\big]_\pi^{2 \pi}\) Primitive of Constant
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \left[{\frac {x^3} 3 + \pi x^2 - \pi^2 x}\right]_0^\pi + \frac 1 \pi \big[{\pi^2 x}\big]_\pi^{2 \pi}\) Primitive of Power
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \left({\left({\frac {\pi^3} 3 + \pi^3 - \pi^3}\right) - \left({\frac {0^3} 3 + \pi \times 0^2 - \pi^2 \times 0}\right) + \left({\pi^2 \times 2 \pi}\right) - \left({\pi^3}\right) }\right)\)
\(\displaystyle \) \(=\) \(\displaystyle \frac {\pi^2} 3 + 2 \pi^2 - \pi^2\)
\(\displaystyle \) \(=\) \(\displaystyle \frac {4 \pi^2} 3\)

$\Box$


For $n > 0$:

\(\displaystyle a_n\) \(=\) \(\displaystyle \frac 1 \pi \int_0^{2 \pi} f \left({x}\right) \cos n x \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \int_0^\pi \left({x - \pi}\right)^2 \cos n x \rd x + \frac 1 \pi \int_\pi^{2 \pi} \pi^2 \cos n x \rd x\) Definition of $f$
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \int_0^\pi \left({x^2 - 2 \pi x + \pi^2}\right) \cos n x \rd x + \frac 1 \pi \int_\pi^{2 \pi} \pi^2 \cos n x \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \int_0^\pi x^2 \cos n x \rd x - 2 \int_0^\pi x \cos n x \rd x + \pi \int_0^\pi \cos n x \rd x + \pi \int_\pi^{2 \pi} \cos n x \rd x\) Linear Combination of Integrals


Splitting this up into bits:


\(\displaystyle \) \(\) \(\displaystyle \pi \int_0^\pi \cos n x \rd x + \pi \int_\pi^{2 \pi} \cos n x \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle \pi \int_0^{2 \pi} \cos n x \rd x\) Sum of Integrals on Adjacent Intervals for Continuous Functions
\(\displaystyle \) \(=\) \(\displaystyle 0\) Integral over $2 \pi$ of $\cos n x$


\(\displaystyle \) \(\) \(\displaystyle 2 \int_0^\pi x \cos n x \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle 2 \left[{\frac {\cos n x} {n^2} + \frac {x \sin n x} n}\right]_0^\pi\) Primitive of $x \cos n x$
\(\displaystyle \) \(=\) \(\displaystyle 2 \left({\frac {\cos n \pi} {n^2} + \frac {\pi \sin n \pi} n}\right) - 2 \left({\frac {\cos 0} {n^2} + \frac {0 \sin 0} n}\right)\)
\(\displaystyle \) \(=\) \(\displaystyle \frac {2 \cos n \pi} {n^2} - \frac {2 \cos 0} {n^2}\) Sine of Multiple of Pi
\(\displaystyle \) \(=\) \(\displaystyle \left({-1}\right)^n \frac 2 {n^2} - \frac 2 {n^2}\) Cosine of Multiple of Pi


\(\displaystyle \) \(\) \(\displaystyle \frac 1 \pi \int_0^\pi x^2 \cos n x \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \left[{\frac {2 x \cos n x} {n^2} + \left({\frac {x^2} n - \frac 2 {n^3} }\right) \sin n x}\right]_0^\pi\) Primitive of $x^2 \cos n x$
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \left({\frac {2 \pi \cos n \pi} {n^2} + \left({\frac {\pi^2} n - \frac 2 {n^3} }\right) \sin n \pi}\right) - \frac 1 \pi \left({\frac {0 \cos 0} {n^2} + \left({\frac 0 n - \frac 2 {n^3} }\right) \sin 0}\right)\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \frac {2 \pi \cos n \pi} {n^2}\) Sine of Multiple of Pi and removal of vanishing terms
\(\displaystyle \) \(=\) \(\displaystyle \left({-1}\right)^n \frac 2 {n^2}\) Cosine of Multiple of Pi


Reassembling $a_n$ from the remaining non-vanishing terms:

\(\displaystyle a_n\) \(=\) \(\displaystyle \left({-1}\right)^n \frac 2 {n^2} - \left({-1}\right)^n \frac 2 {n^2} + \frac 2 {n^2}\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 2 {n^2}\)

$\Box$


Now for the $\sin n x$ terms:

\(\displaystyle b_n\) \(=\) \(\displaystyle \frac 1 \pi \int_0^{2 \pi} f \left({x}\right) \sin n x \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \int_0^\pi \left({x - \pi}\right)^2 \sin n x \rd x + \frac 1 \pi \int_\pi^{2 \pi} \pi^2 \sin n x \rd x\) Definition of $f$
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \int_0^\pi \left({x^2 - 2 \pi x + \pi^2}\right) \sin n x \rd x + \frac 1 \pi \int_\pi^{2 \pi} \pi^2 \sin n x \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \int_0^\pi x^2 \sin n x \rd x - 2 \int_0^\pi x \sin n x \rd x + \pi \int_0^\pi \sin n x \rd x + \pi \int_\pi^{2 \pi} \sin n x \rd x\) Linear Combination of Integrals


Splitting this up into bits:


\(\displaystyle \) \(\) \(\displaystyle \pi \int_0^\pi \sin n x \rd x + \pi \int_\pi^{2 \pi} \sin n x \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle \pi \int_0^{2 \pi} \sin n x \rd x\) Sum of Integrals on Adjacent Intervals for Continuous Functions
\(\displaystyle \) \(=\) \(\displaystyle 0\) Integral over $2 \pi$ of $\sin n x$


\(\displaystyle \) \(\) \(\displaystyle 2 \int_0^\pi x \sin n x \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle 2 \left[{\frac {\sin n x} {n^2} - \frac {x \cos n x} n}\right]_0^\pi\) Primitive of $x \sin n x$
\(\displaystyle \) \(=\) \(\displaystyle 2 \left({\frac {\sin n \pi} {n^2} - \frac {\pi \cos n \pi} n}\right) - 2 \left({\frac {\sin 0} {n^2} - \frac {0 \cos 0} n}\right)\)
\(\displaystyle \) \(=\) \(\displaystyle - \frac {2 \pi \cos n \pi} n\) Sine of Multiple of Pi and removal of vanishing terms


\(\displaystyle \) \(\) \(\displaystyle \frac 1 \pi \int_0^\pi x^2 \sin n x \rd x\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \left[{\frac {2 x \sin n x} {n^2} + \left({\frac 2 {n^3} - \frac {x^2} n}\right) \cos n x}\right]_0^\pi\) Primitive of $x^2 \sin n x$
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \left({\frac {2 \pi \sin n \pi} {n^2} + \left({\frac 2 {n^3} - \frac {\pi^2} n}\right) \cos n \pi}\right) - \frac 1 \pi \left({\frac {0 \sin 0} {n^2} + \left({\frac 2 {n^3} - \frac {0^2} n}\right) \cos 0}\right)\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 1 \pi \left({\left({\frac 2 {n^3} - \frac {\pi^2} n}\right) \cos n \pi}\right) - \frac 1 \pi \left({\frac 2 {n^3} \cos 0}\right)\) Sine of Multiple of Pi and removal of vanishing terms
\(\displaystyle \) \(=\) \(\displaystyle \frac 2 {\pi n^3} \left({\cos n \pi - 1}\right) - \frac \pi n \cos n \pi\) Cosine of Zero is One and simplifying


Reassembling $b_n$ from the remaining non-vanishing terms:

\(\displaystyle b_n\) \(=\) \(\displaystyle \frac 2 {\pi n^3} \left({\cos n \pi - 1}\right) - \frac \pi n \cos n \pi - \left({- \frac {2 \pi \cos n \pi} n}\right)\)
\(\displaystyle \) \(=\) \(\displaystyle \frac 2 {\pi n^3} \left({\cos n \pi - 1}\right) + \frac \pi n \cos n \pi\) simplifying
\(\displaystyle \) \(=\) \(\displaystyle \frac 2 {\pi n^3} \left({\left({-1}\right)^n - 1}\right) + \frac {\left({-1}\right)^n \pi} n\) Cosine of Multiple of Pi

$\Box$


Finally:

\(\displaystyle f \left({x}\right)\) \(\sim\) \(\displaystyle \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty \left({a_n \cos n x + b_n \sin n x}\right)\)
\(\displaystyle \) \(=\) \(\displaystyle \dfrac 1 2 \left({\frac {4 \pi^2} 3}\right) + \sum_{n \mathop = 1}^\infty \left({\frac 2 {n^2} \cos n x + \left({\frac 2 {\pi n^3} \left({\left({-1}\right)^n - 1}\right) + \frac {\left({-1}\right)^n \pi} n}\right) \sin n x}\right)\) substituting for $a_0$, $a_n$ and $b_n$ from above
\(\displaystyle \) \(=\) \(\displaystyle \frac {2 \pi^2} 3 + \sum_{n \mathop = 1}^\infty \left({\frac {2 \cos n x} {n^2} + \left({\frac {\left({-1}\right)^n \pi} n + \frac {2 \left({\left({-1}\right)^n - 1}\right)} {\pi n^3} }\right) \sin n x}\right)\) rearranging

$\blacksquare$


Sources