Inner product theory tells us that two functions are orthogonal on an interval \([a,b]\) if their inner product is 0. The typical inner product that induces the \(L^2\) norm on an infinite dimensional function space, such as the space of real valued functions, is the following:
Note, we want the \(L^2\) norm, as this is the only \(L^p\) space whose norm comes from an inner product,
that turns it into a Hilbert space. With a Hilbert space, we then have a concept of orthogonality. Additionally, we want an \(L^p\) in general (and specifically \(L^2\)) because we are using the Lebesgue integral and measure in our theory and therefore want to deal with functions that are integrable. Now, let's consider some integrals,
Since \(\sin(n\pi) = 0 \ \ \forall n \in \mathbb{Z}\).
By \(\cos\) being even and therefore, \(\cos(-n\pi) = \cos(n\pi)\).
Now we note the two trigonometric formulas,
We can now show orthogonality, consider
Since the sums \(n+m\) and \(n-m\) are integers, we can break this integral up and apply the integral outcomes above:
Which is expected, as a function should not be orthogonal to itself (other than \(0\)). You may wonder about the behavior of the integral when \(n=-m\); in other words, we would have
In other words, for two functions to be orthogonal, we actually need that \(|m| \neq |n|\); this is a consequence of \(\cos\) being even, and therefore when we consider the product, we have
and we know
When \(n = 0\), \(\cos(nx) = 1\) and \(\sin(nx) = 0\). The \(0\) function is orthogonal to any function. Since we showed that the integral of \(\cos(nx)\) and \(\sin(nx)\) are both \(0\), then so is \(1\) multiplied to it (since it doesn't affect the integral by multiplying by \(1\)). Therefore, \(1\) is orthogonal to both \(\cos(nx)\) and \(\sin(nx)\). Therefore, we don't have to consider \(n=0\). Now, consider
when \(|m| \neq |n|\); it evaluates to \(\pi\) when \(m = n\), and to \(-\pi\) when \(n = -m\).
Finally, we first consider the formula for \(|m| \neq |n|\)
Note again, that for \(n = m\) we get \(\pi\) and for \(n=-m\) we get \(-\pi\) since \(\sin\) is odd and therefore we can pull the negative sign to the front and we would just have the negative integral of \(\sin^2\) which we know would be \(-\pi\).
Therefore, we see that for the set of functions
where \(n \in \mathbb{N}\), we have that all functions of this set are orthogonal to each other on the interval \([-\pi, \pi]\).