Theorem: Half-Range Fourier Series/Identity Function/Cosine

The half-range Fourier cosine series for $\map f x$ can be expressed as:
{{begin-eqn}}
{{eqn | l = \map f x
      | o = \sim
      | r = \frac \lambda 2 - \frac {4 \lambda} {\pi^2} \sum_{n \mathop = 0}^\infty \frac 1 {\paren {2 n + 1}^2} \cos \dfrac {\paren {2 n + 1} \pi x} \lambda
      | c = 
}}
{{eqn | r = \frac \lambda 2 - \frac {4 \lambda} {\pi^2} \paren {\cos \dfrac {\pi x} \lambda + \frac 1 {3^2} \cos \dfrac {3 \pi x} \lambda + \frac 1 {5^2} \cos \dfrac {5 \pi x} \lambda + \dotsb}
      | c = 
}}
{{end-eqn}}

Proof:
By definition of half-range Fourier cosine series:
:$\ds \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 = \ds \frac 2 \lambda \int_0^\lambda \map f x \cos \dfrac {n \pi x} \lambda \rd x$
Thus by definition of $f$:
{{begin-eqn}}
{{eqn | l = a_0
      | r = \frac 2 \lambda \int_0^\lambda \map f x \rd x
      | c = Cosine of Zero is One
}}
{{eqn | r = \frac 2 \lambda \int_0^\lambda x \rd x
      | c = Definition of $f$
}}
{{eqn | r = \frac 2 \lambda \intlimits {\frac {x^2} 2} 0 \lambda
      | c = Primitive of Power
}}
{{eqn | r = \frac 2 \lambda \paren {\frac {l^2} 2 - \frac {0^2} 2}
      | c = 
}}
{{eqn | r = \lambda
      | c = simplification
}}
{{end-eqn}}
{{qed|lemma}}
For $n > 0$:
{{begin-eqn}}
{{eqn | l = a_n
      | r = \frac 2 \lambda \int_0^l \map f x \cos \dfrac {n \pi x} \lambda \rd x
      | c = 
}}
{{eqn | r = \frac 2 \lambda \int_0^l x \cos \dfrac {n \pi x} \lambda \rd x
      | c = Definition of $f$
}}
{{eqn | r = \frac 2 \lambda \intlimits {\frac {l^2} {\pi^2 n^2} \cos \dfrac {n \pi x} \lambda + \frac \lambda {\pi n} x \sin \dfrac {n \pi x} \lambda} 0 \lambda
      | c = Primitive of $x \cos n x$
}}
{{eqn | r = \frac 2 \lambda \paren {\paren {\frac {\lambda^2} {\pi^2 n^2} \cos n \pi + \frac {\lambda^2} {\pi n} \sin n \pi} - \paren {\frac {\lambda^2} {\pi^2 n^2} \cos 0 + \frac \lambda {\pi n} 0 \sin 0} }
      | c = 
}}
{{eqn | r = \frac {2 \lambda} {\pi^2 n^2} \paren {\cos n \pi - \cos 0}
      | c = Sine of Multiple of Pi and simplification
}}
{{eqn | r = \frac {2 \lambda} {\pi^2 n^2} \paren {\paren {-1}^n - 1}
      | c = Cosine of Multiple of Pi
}}
{{end-eqn}}
When $n$ is even, $\paren {-1}^n = 1$.
We can express $n = 2 r$ for $r \ge 1$.
Hence in that case:
{{begin-eqn}}
{{eqn | l = a_{2 r}
      | r = \frac {2 \lambda} {\pi^2 n^2} \paren {\paren {-1}^n - 1}
      | c = 
}}
{{eqn | r = \frac {2 \lambda} {\pi^2 n^2} \paren {1 - 1}
      | c = 
}}
{{eqn | r = 0
      | c = 
}}
{{end-eqn}}
When $n$ is odd, $\paren {-1}^n = -1$.
We can express $n = 2 r + 1$ for $r \ge 0$.
Hence in that case:
{{begin-eqn}}
{{eqn | l = a_{2 r - 1}
      | r = \frac {2 \lambda} {\pi^2 \paren {2 r + 1}^2} \paren {-1 - 1}
      | c = 
}}
{{eqn | r = -\frac {4 \lambda} {\pi^2} \paren {\frac 1 {\paren {2 r + 1}^2} }
      | c = rearranging
}}
{{end-eqn}}
Finally:
{{begin-eqn}}
{{eqn | l = \map f x
      | o = \sim
      | r = \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty a_n \cos n x
      | c = 
}}
{{eqn | r = \frac \lambda 2 - \frac {4 \lambda} {\pi^2} \sum_{r \mathop = 0}^\infty \frac 1 {\paren {2 r + 1}^2} \cos \dfrac {\paren {2 r + 1} \pi x} \lambda
      | c = substituting for $a_0$ and $a_n$ from above
}}
{{eqn | r = \frac \lambda 2 - \frac {4 \lambda} {\pi^2} \sum_{n \mathop = 0}^\infty \frac 1 {\paren {2 n + 1}^2} \cos \dfrac {\paren {2 n + 1} \pi x} \lambda
      | c = changing the name of the variable
}}
{{end-eqn}}
{{qed}}
Category:Half-Range Fourier Series for Identity Function
bn9bwtv07mpyi9arm63axdlk5upx99o