# Orthogonality of Sines and Cosines

Cuthbert Nyack
The Fourier series uses an expansion in terms of sines and cosines. This is a convenient expansion because sines and cosines are orthogonal. The applets below illustrate what is meant by orthogonality of sinsin sincos and coscos.

The above applet shows sin(nwt)sin(mwt) (w refers to angular frequency omega) for different n and m. The +ve part of product function is shown shaded red, and the -ve part shaded blue. The red and blue areas cancel out. sin(nwt) is shown in magenta and sin(mwt) in green. When n = m the product is always positive and averages 1/2. the product averages zero whenever n is not equal to m. For large n or m, it is better to reduce the horiz. gain. With horiz gain = 0.2, the width of the applet corresponds to the fundamental period T. Product must be averaged over T (or nT) to get zero. The Average value is shown on the applet. For m not equal to n, the error (< 2E-16) shown is numerical error.

The above applet shows sin(nwt)cos(mwt) for different n and m. Product must be averaged over T (or nT) to get zero.

The applet above shows cos(nwt)cos(mwt) for different n and m. The product averages 1/2 when n = m and is zero otherwise.

When activated the following gif image show how the applets should appear. This case show the orthogonality of sin(8wt)sin(7wt). Note that avery red section has a corresponding blue section which cancels it out. The average is shown as -8.435..E-17 which is numerical error. 