# Intuition behind orthogonal sin functions

When deriving Fourier series, an important step is to establish that the integral of the product of two periodic sin functions is 0 if they have a different frequency.

This then allows you to define Fourier series as the basis for an inner product space.

The usual derivation makes use of trig identities. Here's an example: Orthogonality of sine and cosine integrals.

However I don't find these derivations very intuitive.

Is there another way to see why the integral of sin/cos functions of different frequencies is always 0?

I'm not sure if this is quite what you're looking for, but this is the best I could come up with. Orthogonality of $$\cos(n\theta), \cos(m\theta), \sin(n\theta)$$, and $$\sin(m\theta)$$ for $$n^2 \neq m^2$$ follows directly from orthogonality of $$e^{in\theta}$$ and $$e^{im \theta}$$ for $$n \neq m$$. To understand why $$e^{in\theta}$$ and $$e^{im \theta}$$ are orthogonal for $$n \neq m$$, consider the integral $$\begin{equation} \int_0^{2\pi} e^{i(n-m) \theta} d\theta. \end{equation}$$ As $$\theta$$ ranges from $$0$$ to $$2\pi$$, the integrand traverses the unit circle an integer number of times. By symmetry, it is clear that the real and imaginary parts of this integral are zero. Finally, notice that we can write both $$\sin(n\theta)$$ and $$\cos(n\theta)$$ as linear combinations of $$e^{in\theta}$$ and $$e^{-in\theta}$$. Hence, any product of these trig functions is a linear combination of $$e^{i(n+m)\theta}$$, $$e^{i(n-m)\theta}$$, $$e^{i(m-n)\theta}$$, and $$e^{i(-m-n)\theta}$$. The corresponding integrals are all zero by orthogonality of the complex exponentials since $$n^2 \neq m^2$$.
Perhaps finite Fourier series is more intuitive because instead of infinite series and integrals you only have to deal with finite sums. This is described in the Wikipedia article Discrete Fourier transform. Notice that $$\,\exp(i\theta) = \cos(\theta)+i\sin(\theta)\,$$ so you can extract $$\,\sin\,$$ and $$\,\cos\,$$ by using real and imaginary parts of $$\,\exp(i\theta).$$
Fix an integer $$\,N>0\,$$ and suppose $$\,z\,$$ is a number such that $$\,z,z^2,z^3,\dots, z^N=1\,$$ are all different. Such a number is a primitive $$N$$th root of unity. Define the geometric sequences $$\,w_k(j) := z^{jk}\,$$ for any integers $$\,j,k.\,$$ Each such sequence satisfies $$\, w_k(j) = w_j(k),\,$$ $$\, w_k(i+j) = w_k(i)w_k(j)\,$$ and $$\, w_k(j+N) = w_{k+N}(j) = w_k(j).\,$$ Thus, only $$\,N\,$$ of these sequences are distinct and so we can uniquely express any sequence of numbers of period $$\,N\,$$ as a sum of these geometric sequences.
To determine the coefficients of such an expression we can use the important identity (because roots of unity are the vertices of a regular polygon inscribed in the unit circle) $$\sum_{j=0}^{N-1} w_k(j) = 0 \;\;\text{ if }\;\;0 But $$\sum_{j=0}^{N-1} w_0(j) = N \;\;\text{ since }\;\; w_0(j)=1.$$
Now if $$\,\{a_0,a_1,\dots,a_k,\dots\}\,$$ is any period $$\,N\,$$ sequence, then $$\,a_j = \sum_{k=0}^{N-1} c_k\,w_k(j)\,$$ where $$\, c_k := \frac1N \sum_{j=0}^{N-1} a_j\,w_k(-j).\,$$
Now Fourier series is just the limit of period $$\,N\,$$ Fourier series as $$\,N\to\infty.$$