Fourier Series/Cosine Series for x over 0 to Pi

From ProofWiki
Jump to: navigation, search

Theorem

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

$f \left({x}\right) = x$


Then its Fourier series can be expressed as:

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


Proof

By definition of half-range Fourier cosine series:

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


where for all $n \in \Z_{> 0}$:

$a_n = \displaystyle \frac 2 \pi \int_0^\pi f \left({x}\right) \cos n x \rd x$


Thus by definition of $f$:

\(\displaystyle a_0\) \(=\) \(\displaystyle \frac 2 \pi \int_0^\pi f \left({x}\right) \rd x\) $\quad$ Cosine of Zero is One $\quad$
\(\displaystyle \) \(=\) \(\displaystyle \frac 2 \pi \int_0^\pi x \rd x\) $\quad$ Definition of $f$ $\quad$
\(\displaystyle \) \(=\) \(\displaystyle \frac 2 \pi \left[{\frac {x^2} 2}\right]_0^\pi\) $\quad$ Primitive of Power $\quad$
\(\displaystyle \) \(=\) \(\displaystyle \frac 2 \pi \left({\frac {\pi^2} 2 - \frac {0^2} 2}\right)\) $\quad$ $\quad$
\(\displaystyle \) \(=\) \(\displaystyle \pi\) $\quad$ simplification $\quad$

$\Box$


For $n > 0$:

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


When $n$ is even, $\left({-1}\right)^n = 1$.

We can express $n = 2 r$ for $r \ge 1$.

Hence in that case:

\(\displaystyle a_{2 r}\) \(=\) \(\displaystyle \frac 2 \pi \left({\frac {\left({-1}\right)^n} {n^2} - \frac 1 {n^2} }\right)\) $\quad$ $\quad$
\(\displaystyle \) \(=\) \(\displaystyle \frac 2 \pi \left({\frac 1 {n^2} - \frac 1 {n^2} }\right)\) $\quad$ $\quad$
\(\displaystyle \) \(=\) \(\displaystyle 0\) $\quad$ $\quad$


When $n$ is odd, $\left({-1}\right)^n = -1$.

We can express $n = 2 r - 1$ for $r \ge 1$.

Hence in that case:

\(\displaystyle a_{2 r - 1}\) \(=\) \(\displaystyle \frac 2 \pi \left({\frac {-1} {\left({2 r - 1}\right)^2} - \frac 1 {\left({2 r - 1}\right)^2} }\right)\) $\quad$ $\quad$
\(\displaystyle \) \(=\) \(\displaystyle -\frac 4 \pi \left({\frac 1 {\left({2 r - 1}\right)^2} }\right)\) $\quad$ simplifying $\quad$


Finally:

\(\displaystyle f \left({x}\right)\) \(\sim\) \(\displaystyle \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty a_n \cos n x\) $\quad$ $\quad$
\(\displaystyle \) \(=\) \(\displaystyle \frac \pi 2 - 4 \pi \sum_{r \mathop = 1}^\infty \frac 1 {\left({2 r - 1}\right)^2} \cos \left({2 r - 1}\right) x\) $\quad$ substituting for $a_0$ and $a_n$ from above $\quad$
\(\displaystyle \) \(=\) \(\displaystyle \frac \pi 2 - 4 \pi \sum_{n \mathop = 1}^\infty \frac {\cos \left({2 n - 1}\right) x} {\left({2 n - 1}\right)^2}\) $\quad$ changing the name of the variable and rearranging $\quad$

$\blacksquare$



Sources