Half-Range Fourier Series/Identity Function/Cosine

Theorem
Let $\lambda \in \R_{>0}$ be a strictly positive real number.

Let $\map f x: \openint 0 \lambda \to \R$ be the identity function on the open real interval $\openint 0 \lambda$:
 * $\forall x \in \openint 0 \lambda: \map f x = x$

The half-range Fourier cosine series for $\map f x$ can be expressed as:

Proof
By definition of half-range Fourier cosine series:


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

where for all $n \in \Z_{> 0}$:
 * $a_n = \displaystyle \frac 2 \lambda \int_0^\lambda \map f x \cos \dfrac {n \pi x} \lambda \rd x$

Thus by definition of $f$:

For $n > 0$:

When $n$ is even, $\paren {-1}^n = 1$.

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

Hence in that case:

When $n$ is odd, $\paren {-1}^n = -1$.

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

Hence in that case:

Finally: