<s>[INST] Show that the system of trigonometric functions is an orthogonal system The space consisting of all continuous functions on the interval $[a, b]$ equipped with the inner product $\langle f, g \rangle := \int^{b}_{a} f(t)g(t)dt$ is given. Show that the system of trigonometric functions
$$1, \cos \Big (\frac{2\pi nt}{b - a} \Big), \sin \Big (\frac{2\pi nt}{b - a} \Big) \quad \quad n \in \mathbb{N} \setminus \{0 \}$$
is an orthogonal system.
We have to show that the above elements are mutually perpendicular, that is that $\langle x, y \rangle = 0$ for each pair of elements in the above system.
When I try solving $\langle x, y \rangle = 0$, I get stuck on the following:
\begin{equation}
\begin{split}
\langle 1, \cos \Big (\frac{2\pi nt}{b - a} \Big) \rangle & = \int^{b}_{a} \cos \Big (\frac{2\pi nt}{b - a} \Big) dt \\
 & = \Big[ \sin \Big (\frac{2\pi nt}{b - a} \Big) \Big ]^{b}_{a} \frac{b - a}{2 \pi n} \\
& = \Big ( \sin \Big (\frac{2\pi nb}{b - a}\Big ) - \sin \Big (\frac{2\pi na}{b - a} \Big )\Big ) \frac{b - a}{2 \pi n} \\
& = \Big ( \sin \Big (\frac{2\pi nb}{b - a}\Big ) + \sin \Big (\frac{-2\pi na}{b - a} \Big )\Big ) \frac{b - a}{2 \pi n}.
\end{split}
\end{equation}
Similarly, 
\begin{equation}
\begin{split}
\langle 1, \sin \Big (\frac{2\pi nt}{b - a} \Big) \rangle & = \int^{b}_{a} \sin \Big (\frac{2\pi nt}{b - a} \Big) dt \\
 & = \Big[ -\cos \Big (\frac{2\pi nt}{b - a} \Big) \Big ]^{b}_{a} \frac{b - a}{2 \pi n} \\
& = \Big ( -\cos \Big (\frac{2\pi nb}{b - a}\Big ) + \cos \Big (\frac{2\pi na}{b - a} \Big )\Big ) \frac{b - a}{2 \pi n}.
\end{split}
\end{equation}
And for $u = \sin \Big (\frac{2\pi nt}{b - a} \Big)$, $du = \cos \Big (\frac{2\pi nt}{b - a} \Big)\frac{2 \pi n}{b-a}dt$, $\cos \Big (\frac{2\pi nt}{b - a} \Big) dt = \frac{b - 1}{2 \pi n}du$ we have
\begin{equation}
\begin{split}
\langle \cos \Big (\frac{2\pi nt}{b - a} \Big), \sin \Big (\frac{2\pi nt}{b - a} \Big) \rangle & = \int^{b}_{a} \cos \Big (\frac{2\pi nt}{b - a} \Big)\sin \Big (\frac{2\pi nt}{b - a} \Big) dt \\
 & = \int^{u(a)}_{u(b)}\frac{b - a}{2 \pi n}u du \\
& = \frac{b - a}{2 \pi n}\frac{1}{2} \Big [ u^{2} \Big ]^{u(b)}_{u(a)} \\
& = \frac{b - a}{4 \pi n} \Big [ \sin^{2}\Big (\frac{2\pi nt}{b - a} \Big) \Big ]^{b}_{a} \\
& = \frac{b - a}{4 \pi n} \Big ( \sin^{2}\Big (\frac{2\pi nb}{b - a}\Big ) - \sin^{2}\Big (\frac{2\pi na}{b - a} \Big )\Big ) \\
& = \frac{b - a}{4 \pi n} \Big ( \sin^{2}\Big (\frac{2\pi nb}{b - a}\Big ) + \sin^{2}\Big (-\frac{2\pi na}{b - a} \Big )\Big ).
\end{split}
\end{equation}
It seems to me that the inner products above are only equal to zero when $a = b$ which would give division by zero.
However, when I take $b = \pi$ and $a = -\pi$, the orthogonality follows. I think that I am missing something trivial about trigonometric functions (i.e. a property).
 [/INST] Note that for all $a\not=b$, we have that 
$$
\sin \Big (\frac{2\pi nb}{b - a}\Big )
=\sin \Big (\frac{2\pi n[(b-a)+a]}{b - a}\Big )
=\sin \Big (2\pi n+\frac{2\pi n a}{b - a}\Big )
=\sin \Big (\frac{2\pi n a}{b - a}\Big ).
$$
Similarly for the cosine function.
</s>