The principle of superposition may be applied to waves whenever two (or more) waves travelling through the same medium at the same time. The waves pass through each other without being disturbed. The net displacement of the medium at any point in space or time, is simply the sum of the individual wave displacements. This is true of waves which are finite in length (wave pulses) or which are continuous sine waves.
Two waves of equal amplitude are travelling in the same direction. The two waves have different frequencies and wavelengths, but they both travel with the same wave speed. Using the principle of superposition, the resulting particle displacement may be written as:
This resulting particle motion is the product of two travelling waves. One part is a sine wave which oscillates with the average frequency f = Â½(f1 + f2). This is the frequency which is perceived by a listener. The other part is a cosine wave which oscillates with the difference frequency f = Â½(f1 - f2). This term controls the amplitude "envelope" of the wave and causes the perception of "beats". The beat frequency is actually twice the difference frequency, fbeat = (f1 - f2).
Hope this helps.