We showed above that \(\langle \sin mx, \sin nx \rangle=0\) for all \(m,n\) when \(m
\neq n\text{.}\) Therefore \(\langle (\sin mx)/\sqrt{\pi}, (\sin nx)/\sqrt{\pi} \rangle\) also equals 0 for \(m \neq n\text{.}\) For simpler notation let
\begin{align*}
s_n(x) \amp = \frac{1}{\sqrt{\pi}}\sin n x, \qquad \text{for $n \gt 0$} \\
c_n(x) \amp = \begin{cases}
\frac{1}{\sqrt{2\pi}} \amp n = 0, \\
\frac{1}{\sqrt{\pi}} \cos nx \amp n \gt 0,
\end{cases}
\end{align*}
First, we will show that
\(\langle s_m (x), c_n(x) \rangle=0\) for all
\(n, m \gt 0\) .
\begin{align*}
\langle s_m (x), c_n (x) \rangle \amp = \biggl\langle \frac{1}{\sqrt{\pi}}\sin mx,
\frac{1}{\sqrt{\pi}}\cos nx \biggr\rangle \\
\amp = \frac{1}{\pi} \int_{-\pi}^{\pi} \sin mx \cos nx \,dx \\
\amp = \frac{1}{\pi} \int_{-\pi}^{\pi} \frac{e^{imx} - e^{-imx}}{2i}
\frac{e^{inx}+e^{-inx}}{2} \, dx \\
\amp = \frac{1}{4i\pi} \int_{-\pi}^{\pi} \bigl(
e^{i(m+n)x}-e^{i(n-m)x}+e^{i(m-n)x}-e^{-i(m+n)x} \bigr) \, dx \\ \amp = 0
\end{align*}
since each integral is zero from
LemmaΒ 6.1.5. Next, we will show that
\(\langle c_m(x), c_n(x) \rangle = 0\) for all
\(n,m >0\) such that
\(n
\neq m\text{.}\)
\begin{align*}
\langle c_m (x), c_n (x) \rangle \amp =\biggl\langle \frac{1}{\sqrt{\pi}}\cos mx,
\frac{1}{\sqrt{\pi}}\cos nx \biggr\rangle\\
\amp = \frac{1}{\pi} \int_{-\pi}^{\pi} \cos mx \cos nx \,dx\\
\amp = \frac{1}{\pi} \int_{-\pi}^{\pi} \frac{e^{imx} + e^{-imx}}{2}
\frac{e^{inx}+e^{-inx}}{2} \, dx\\
\amp = \frac{1}{4\pi} \int_{-\pi}^{\pi} \bigl( e^{i(m+n)x}
+e^{i(n-m)x}+e^{i(m-n)x}+e^{-i(m+n)x} \bigr) \, dx \\
\amp= 0
\end{align*}
because again each integral is zero from Lemma
LemmaΒ 6.1.5. Also,
\begin{align*}
\langle c_m, c_0 \rangle \amp = \int_{-\pi}^{\pi} \frac{1}{\sqrt{2\pi}} \cos mx \, dx\\
\amp = -\frac{1}{m\sqrt{2\pi}} \sin mx \biggr|_{-\pi}^{\pi} = 0
\end{align*}
Lastly, we need to show that the norm of each of the functions is 1.
\begin{align*}
\langle c_0, c_0 \rangle \amp = \int_{-\pi}^{\pi} \biggl(\frac{1}{\sqrt{2\pi}}
\biggr)^2 \, dx = \int_{-\pi}^{\pi} \frac{1}{2\pi} \, dx = 1 ,\\
\langle c_n, c_n \rangle \amp =\frac{1}{\pi} \int_{-\pi}^{\pi} \cos^2 nx \, dx \\
\amp = \frac{1}{\pi} \int_{-\pi}^{\pi} \biggl( \frac{e^{inx} + e^{-inx}}{2}
\biggr)^2 \, dx \\
\amp = \frac{1}{4\pi} \int_{-\pi}^{\pi} \bigl( e^{2inx} + 2 + e^{-2inx} \bigr) \,
dx
\end{align*}
and the integrals of the first and third terms are zero from Lemma
LemmaΒ 6.1.5.
\begin{align*}
\amp = \frac{1}{4\pi} \int_{-\pi}^{\pi} 2 \, dx = 1 \\
\langle s_n, s_n \rangle \amp =\frac{1}{\pi} \int_{-\pi}^{\pi} \sin^2 nx \, dx \\
\amp = \frac{1}{\pi} \int_{-\pi}^{\pi} \biggl( \frac{e^{inx} - e^{-inx}}{2i}
\biggr)^2 \, dx \\
\amp = \frac{1}{(2i)^2\pi} \int_{-\pi}^{\pi} \bigl( e^{2inx} - 2 + e^{-2inx}
\bigr) \, dx
\end{align*}
and the integrals of the first and third terms are zero from Lemma
LemmaΒ 6.1.5.
\begin{align*}
\amp = \frac{1}{-4\pi} \int_{-\pi}^{\pi} -2 \, dx = 1
\end{align*}
This shows that the set of functions given above is an orthonormal set of functions.