## Trigonometric Series Approximations

The trigonometric functions are useful for modeling periodic behavior. For example, we may describe the motion of an object oscillating at the end of a spring (ignoring any damping forces, such as friction, and assuming the object is at x = 0 at time t = 0) with

x(t) = asin(ωt),

where a is the amplitude of the motion and ω/2π is the frequency of the motion.

#### Sound waves

For a more complicated example, consider the motion of a molecule of air as a sound wave passes. The action of the sound wave causes a particular molecule of air to oscillate back and forth about some equilibrium position. If we let x(t) represent the position of the air molecule at time t, with x = 0 corresponding to the equilibrium position and x considered to be positive in one direction from the equilibrium position and negative in the other, then for many sounds x will be a periodic function of t. In general, this will be true for musical sounds, but not true for sounds we would normally classify as noise. Moreover, even if x is a periodic function, it need not be simply a sine or cosine function. The graph of x for a musical sound, although periodic, may be very complicated. However, many simple sounds, such as the sound of a tuning fork, are represented by sine curves. For example, if x is the displacement of an air molecule for a tuning fork which vibrates at 440 cycles per second with a maximum displacement from equilibrium of 0.002 centimeters, then

x(t) = 0.002sin(880πt).

In the early part of the 19th century, Joseph Fourier (1768-1830) showed that the story does not end here. Fourier demonstrated that any "nice" periodic curve (for example, one which is continuous) can be approximated as closely as desired by a sum of sine and cosine functions. In particular, this means that for any musical sound the function x may be approximated well by a sum of sine and cosine functions. For example, in his book The Science of Musical Sounds (Macmillan, New York, 1926), Dayton Miller shows that, with an appropriate choice of units, the sequence of functions

 x1(t) = 22.4sin(t) + 94.1cos(t) x2(t) = x1(t) + 49.8sin(2t) - 43.6cos(2t) x3(t) = x2(t) + 33.7sin(3t) - 14.2cos(3t) x4(t) = x3(t) + 19.0sin(4t) - 1.9cos(4t) x5(t) = x4(t) + 8.90sin(5t) - 5.22cos(5t) x6(t) = x5(t) - 8.18sin(6t) - 1.77cos(6t) x7(t) = x6(t) + 6.40sin(7t) - 0.54cos(7t) x8(t) = x7(t) + 3.11sin(8t) - 8.34cos(8t) x9(t) = x8(t) - 1.28sin(9t) - 4.10cos(9t) x10(t) = x9(t) - 0.71sin(10t) - 2.17cos(10t)

give successively better approximations to the displacement curve of a sound wave generated by the tone C3 of an organ pipe. Notice that the terms in this expression for x(t) are written in pairs with frequencies which are always integer multiples of the frequency of the first pair. This is a general fact which is part of Fourier's theory; if we added more terms to obtain more accuracy, the next terms would be of the form

asin(11t) + bcos(11t)

for some constants a and b. Notice also that the amplitudes of the sine and cosine curves tend to decrease as the frequencies are increasing. As a consequence, the higher frequencies have less impact on the total curve. Put another way, Fourier's theorem says that every musical sound is the sum of simple tones which could be generated by tuning forks. Hence in theory, although certainly not in practice, the instruments of any orchestra could all be replaced by tuning forks. On a more practical level, Fourier's analysis of periodic functions has been fundamental for the development of such modern conveniences as radios, televisions, stereos, and compact disc players.

In the applet below, clicking on the buttons will load an audio file to play the given tone for the functions x1 through x10 described above. The units are scaled so that the fundamental is played at a frequency of 261 cycles per second (middle C). Each audio file is 41k, and so may take a moment to download the first time you play it. As overtones are added, you can see the complexity of the motion increase, while remaining periodic.

#### Square wave

The function x(t) which is 1 for 0 ≤ t < 0.5 and -1 for 0.5 ≤ t < 1, and then repeats these values over every interval of length 1, is an example of a square wave. The following applet plots this square wave along with an approximating trigonometric series. If n terms are requested, the approximating sum is

pn(t) = (π/2)1/2(sin(2πt) + sin(6πt)/3 + . . . + sin(2π(2n-1)t)/n).

Note that although pn is continuous, it approximates the discontinuous square wave well for even small values of n. At the same time, note that the error in approximation at the points of discontinuity of x does not appear to be decreasing in the same way as it does at points of continuity.

#### Exercises

1. According to Dayton Miller in The Science of Musical Sounds, the function

x(t) = 151sin(t) - 67cos(t) + 24sin(2t) + 55cos(2t) + 27sin(3t) + 5cos(3t)

gives a good approximation to the shape of the displacement curve for the tone B4 played on the E string of a violin.

1. Graph each of the individual terms of x on the interval [-15, 15]. Use a common scale for the vertical axis.

2. Graph x on [-15, 15].

3. Graph x and its individual terms (a total of 7 graphs) together on the interval [-15, 15].

2. Suppose we define a function f by saying that it is periodic with period 1 and that f(x) = 1 - 2x for 0 ≤ x < 1.

1. Sketch the graph of f over the interval [-3, 3].

2. Let

gn(x) = 2(sin(2πx)/π + sin(4πx)/2π + sin(6πx)/3π + . . . + + sin(2nπx)/nπ)

What is the period of gn? Graph g1, g2, g3, g4, g5, and g10 over the interval [-3, 3].

3. What do you think happens to gn as n gets large?

3. For an interesting account of sound waves, Fourier's theorem, and related ideas in electromagnetism, read Chapters 19 ("The Sine of G Major") and 20 ("Mastery of the Ether Waves") in Morris Kline's Mathematics in Western Culture (Oxford University Press, 1953).