Fourier Series/Triangle Wave

Theorem
Let $\map T x$ be the triangle wave defined on the real numbers $\R$ as:


 * $\forall x \in \R: \map T x = \begin {cases}

\size x & : x \in \closedint {-l} l \\ \map T {x + 2 l} & : x < -l \\ \map T {x - 2 l} & : x > +l \end {cases}$ where:
 * $l$ is a given real constant
 * $\size x$ denotes the absolute value of $x$.

Then its Fourier series can be expressed as:

Proof
By definition, the absolute value function is an even function:


 * $\size {-x} = x = \size x$

Thus by Fourier Series for Even Function over Symmetric Range, $\size x$ can be expressed as:


 * $\displaystyle \size x \sim \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty a_n \cos \dfrac {n \pi x} l$

where for all $n \in \Z_{\ge 0}$:
 * $a_n = \displaystyle \frac 2 l \int_0^l \size x \dfrac {n \pi x} l \rd x$

On the real interval $\closedint 0 l$:
 * $\size x = x$

and so for all $n \in \Z_{\ge 0}$:
 * $a_n = \displaystyle \frac 2 \pi \int_0^\pi x \dfrac {n \pi x} l \rd x$

Thus Fourier Cosine Series for $x$ can be applied directly.

So for $x \in \closedint {-l} l$:


 * $\displaystyle \size x = \frac l 2 - \frac {4 l} {\pi^2} \sum_{n \mathop = 0}^\infty \frac 1 {\paren {2 n + 1}^2} \cos \dfrac {\paren {2 n + 1} \pi x} l$