Beats

s[f_, t_] := Cos[2 π f t]

y1[t_] := s[20, t]
y2[t_] := s[22, t]
y[t_] := y1[t] + y2[t]

Plot[{y1[t], y2[t], y[t]}, {t, 0, 1}, PlotStyle->{Red, Blue, Black}, 
ImageSize->Scaled[0.8], LabelStyle -> Larger, Frame -> True, FrameLabel -> {"t (s)", "Amplitude"}]

beatsfigure = Plot[{y1[t], y2[t] - 2, y[t]-5}, {t, 0, 1}, PlotStyle->{Red, Blue, Black},PlotPoints->500,
ImageSize->Scaled[0.8], LabelStyle -> Larger, Frame -> True, FrameLabel -> {"t (s)", "Amplitude"}]

SetDirectory[NotebookDirectory[]]; (* Export["Ch16-beats-graph.jpg", beatsfigure] *)

y1[t_] := s[200, t]
y2[t_] := s[202, t]
y[t_] := y1[t] + y2[t]

Plot[{y1[t] - 2, y2[t], y[t]+3}, {t, 0, 0.5}, PlotPoints->500,PlotStyle->{Red, Blue, Black},
ImageSize->Scaled[0.8], LabelStyle -> Larger, Frame -> True, FrameLabel -> {"t (s)", "Amplitude"}]

Plot[{y1[t] - 2, y2[t], y[t]+3}, {t, 0, 1}, PlotPoints->500, PlotStyle->{Red, Blue, Black},
ImageSize->Scaled[0.8], LabelStyle -> Larger, Frame -> True, FrameLabel -> {"t (s)", "Amplitude"}]

Play two sounds, one at 200 Hz, the other at a nearby frequency.  Notice how the beat frequency is equal to |200 - f2|.

Play[{s[200,t], s[202, t]}, {t, 0, 6}]

Manipulate[Play[{s[200,t], s[f2, t]}, {t, 0, 4}], {{f2, 200}, 190, 210, 1, Appearance -> "Open"}]

Manipulate[Plot[{s[200,t] - 2, s[f2, t], s[200,t] + s[f2,t] +3}, {t, 0, 1.0}, 
PlotPoints->1000,PlotStyle->{Red, Blue, Black},
ImageSize->Scaled[0.8], LabelStyle -> Larger, Frame -> True, FrameLabel -> {"t (s)", "Amplitude"}], {{f2,200}, 190, 210, 1, Appearance->"Open"},ControlPlacement->Top]