Chapter 3

Sine and cosine graphs

Turn the point at a steady rate and plot its height against the arc it has walked. The wave is the circle, unrolled.

13 min read · 6 interactive figures

Drag the point, or press Play. The height of the point, carried across, traces the sine wave.

The graph of y = sin x is the height of a point on the unit circle, plotted against the distance the point has walked around the rim. Walk at a steady pace and the height rises, falls, dips below the axis and comes back, repeating every 2π. The graph of y = cos x is the same wave shifted a quarter turn to the left. Every feature of both graphs, their range, their zeros, their period and their shape, can be read off the circle[1].

Unrolling the circle

Press Play and watch both coordinates at once. The vermilion curve is the point’s height, sin θ. The blue curve is its x-coordinate, cos θ, turned to run in the same direction so you can compare them. The horizontal axis is the angle in radians, which is the same thing as the arc walked on a circle of radius 1.

Figure 1 Press Play, or drag the point. The vermilion wave is sin θ and the blue wave is cos θ, traced out as the point goes around. The dashed line carries the point’s height across to the sine wave.#

Everything in the standard list of facts about the graphs is something you can watch happen:

  • Range. Both waves stay between −1 and 1, because the point never leaves a circle of radius 1.
  • Period. Both repeat every 2π, one trip around the rim. That is 360° in degrees, but the graph is drawn in radians because the horizontal axis is a distance.
  • Zeros. Sine is zero when the point is on the x-axis, at 0, π, 2π and so on. Cosine is zero when the point is on the y-axis, at π/2, 3π/2, ….
  • The shift between them. Cosine reaches each value a quarter turn before sine does, so cos x = sin(x + π/2). The cosine graph is the sine graph slid left by π/2[2].
  • Symmetry. Turning the other way flips the height but not the x-coordinate. So sin(−x) = −sin x (the sine graph has rotational symmetry about the origin) and cos(−x) = cos x (the cosine graph is a mirror image of itself in the y-axis).

Why this particular shape?

Why a smooth wave and not a zigzag? Look at how the point moves. At the top of the circle it is moving sideways, so its height is hardly changing: the wave is flat at its peak. As it crosses the x-axis it is moving straight up or down, so its height changes fastest: the wave is steepest at its zeros. In fact the rate at which the height changes is exactly the point’s x-coordinate, which is the statement in calculus that the derivative of sin x is cos x[3]. That statement is true only with x in radians (Euler’s convention of 1748, in which the arc and the angle are the same number[4]), for the reason given in Chapter 2.

This is also why sine waves turn up wherever something goes around at a steady rate and you watch only one coordinate of it. A peg on a turning wheel, seen edge-on, moves up and down in exactly this wave.

The derivative of sine is cosine: the velocity, turned a quarter turn

That last observation can be made exact. A point going round the unit circle at one radian per second always moves along the circle, at right angles to its radius, with speed 1. Its velocity is therefore the radius turned through 90°: the vector (−sin θ, cos θ). Its upward part, cos θ, is the rate at which the height sin θ changes, and its sideways part, −sin θ, is the rate at which cos θ changes. In the language of calculus, d/dθ sin θ = cos θ and d/dθ cos θ = −sin θ[5]. established Both rules hold only with θ in radians: measured in degrees, the rate picks up a factor of π/180.

Figure 2 Drag the point. The black arrow is its velocity; its blue upward part is cos θ and its vermilion sideways part is −sin θ. On the graph, the black segment is the slope of the sine curve at the cursor: it always equals the height of the cosine curve there. The bracket shows that the cosine wave is the sine wave a quarter turn early.#

Because turning the radius a quarter turn turns sine into cosine, differentiating twice turns the radius half a turn: the second derivative of sin θ is −sin θ. That is the equation of a mass on a spring, and it is why the shadow of steady circular motion is the motion of a spring: both obey “acceleration is minus position”[6].

Amplitude, period, phase and midline

Most sine waves in the world are not y = sin x exactly. They are taller or shorter, faster or slower, start somewhere else, or ride above or below zero. All of that fits into one formula with four numbers:

y = A sin(B(x − C)) + D(3.1)
Question 1 A prediction about the period.#
Figure 3 Drag the three handles. The vermilion handle sets the amplitude (up and down) and the phase shift (sideways); the blue handle at the end of the first cycle sets the period; the green handle moves the midline. The gray curve is plain y = sin x for comparison.#

Each number has a meaning on the circle.

A, the amplitude, is the radius of the circle. A point on a circle of radius 3 rises to 3 and falls to −3, so the wave runs between those heights. A negative A flips the wave upside down, the same as starting the point at the bottom.

B, the frequency, is how fast the point goes around: B radians of turn for each unit of x. A full turn therefore takes 2π/B units, which is the period. Doubling B halves the period.

C, the phase shift, is a delay. The wave does at x = C what plain sine does at 0, so the graph slides right by C. Watch the trap when the formula is written without brackets: y = sin(2x − π/2) is sin(2(x − π/4)), a shift of π/4, not π/2. Textbooks that write the general form as A sin(Bx − C) + D give the shift as C/B for that reason[1].

D, the midline, lifts the center of the circle. The wave swings about y = D, between D − |A| and D + |A|.

A worked example puts all four together. For y = 3 sin(2(x − π/4)) + 1, the amplitude is 3, the period is 2π/2 = π, the wave is shifted π/4 to the right, and it swings about y = 1, from a minimum of −2 to a maximum of 4. Its first peak is where 2(x − π/4) = π/2, at x = π/2. Set the sliders to A = 3, B = 2, C = 0.79, D = 1 and check.

Tangent: a graph with gaps

The tangent graph looks nothing like a wave, and the circle explains why. Recall from Chapter 1 that tan θ is the height at which the extended radius meets the line x = 1. Carry that yellow bar across to a graph and you get the curve below.

Figure 4 The yellow tangent bar, carried across to a graph. Drag the point toward 90°: the bar grows without bound, and on the graph the curve shoots up beside a vertical asymptote. Past 90° it reappears from far below.#

Three features follow from the picture[1]. Tangent is zero where sine is, at multiples of π. It is undefined where cosine is zero, at π/2 + kπ, because there the extended radius runs parallel to the line x = 1 and never meets it; the graph has a vertical asymptote at each of those places. And tangent repeats every π, not every 2π: the point at θ + π is diametrically opposite, on the same line through the center, so it hits the tangent line at the same height. Between asymptotes the graph climbs from −∞ to +∞, passing through the origin with slope 1, which is the small-angle fact tan θ ≈ θ again.

Reading the graph backwards: arcsin, arccos, arctan

The graphs answer a question in both directions. Forwards: given an angle, how high is the point? Backwards: given a height, which angle? The backwards question has a catch that the graph makes obvious. Draw the horizontal line y = 1/2 across the sine wave and it cuts the wave twice in every period: at π/6 and 5π/6, then again at those angles plus 2π, plus 4π, and so on, forever. On the circle, the line y = 1/2 meets the circle at two points, one in quadrant I and its mirror image in quadrant II. So the equation sin θ = 1/2 has infinitely many solutions:

θ = π6 + 2kπ   or   θ = 5π6 + 2kπ,   k any whole number(3.3)

A calculator cannot return infinitely many answers, so its inverse-sine key returns one, chosen by a convention. The convention is to restrict sine to a stretch of the graph where it takes every value from −1 to 1 exactly once and keeps rising: −π/2 to π/2, the right-hand half of the circle. On that stretch each height has one angle, and that angle is arcsin, written sin⁻¹ on most calculators[1]. established The other solutions you then recover from the circle: the mirror image across the y-axis gives π − arcsin y, and adding whole turns gives the rest.

The other two inverses make the same choice for their own reasons. Cosine falls steadily from 1 to −1 as the point moves over the top half of the circle, from 0 to π, so arccos answers between 0 and π. Tangent climbs from −∞ to +∞ between its asymptotes at −π/2 and π/2, so arctan answers strictly between them, which is exactly why arctan cannot tell quadrant II from quadrant IV and why the polar chapter needs a two-argument version. The notation causes its own trouble: sin⁻¹x means arcsin x, the inverse function, while sin²x means (sin x)². The superscript −1 is the one exponent in trigonometry that does not mean a power, and 1/sin x has its own name, csc x.

Where sine waves are measured

The formula with four numbers is not a classroom exercise. It is the working description of several things you can measure, and each of the four numbers turns out to be something an engineer or a scientist reads off an instrument.

The voltage in a wall socket. A generator turns a coil at a steady rate inside a magnetic field, and the voltage it produces is the height of a point on a turning circle: v = V0 sin ωt[7]. In North America the circle turns 60 times a second, so the period is 1/60 of a second, about 16.7 milliseconds, and ω = 2π × 60 ≈ 377 radians per second. The amplitude V0 is about 170 volts. The familiar “120 volts” is not the peak: it is the steady voltage that would deliver the same power, and for a sine wave that is the peak divided by √2 (170/√2 ≈ 120). In most of Europe the same wave runs at 50 hertz with a peak of about 311 volts[7]. established Here the frequency is fixed by the speed of the generators, the amplitude by the grid, and the phase matters too: three-phase power uses three of these waves, a third of a turn (2π/3) apart.

The tide. The sea does not rise and fall in a single sine wave, but it is well described by a sum of them. The U.S. National Oceanic and Atmospheric Administration (NOAA) predicts tides by adding 37 cosine curves, each with its own amplitude, phase and fixed period, the “harmonic constituents” of the tide at that place[8]. established The largest, called M2, is driven by the Moon and has a period of about 12.42 hours, two highs in every 24 hours and 50 minutes, because the Moon returns to the same place overhead about 50 minutes later each day. The periods are set by astronomy and are the same everywhere; the amplitudes and phases are different at every harbour and have to be measured, which is why NOAA needs a long record at a station (a year of data to see all 37 directly) before it can publish predictions for it[8].

Sound. A tuning fork vibrates almost exactly as a sinusoid. Its pitch is the frequency and its loudness grows with the amplitude. The ear does not hear phase in a single tone at all, which is a reminder that the four numbers are not equally important in every application.

Every periodic wave is a sum of sine waves

The tide suggests a bolder idea. If one turning circle gives a sine wave, several circles turning at different rates, added together, give a more complicated wave. How complicated? In a memoir on the flow of heat read to the Paris Institute in December 1807, Joseph Fourier claimed that essentially any periodic function can be built this way, from sines and cosines whose frequencies are whole-number multiples of one basic frequency. Lagrange and Laplace objected to his trigonometric series, and the full theory was published only in 1822, in his Théorie analytique de la chaleur[9]. documented The objections were reasonable at the time: making the claim precise, and finding out exactly which functions it covers, occupied mathematicians for the rest of the century.

The most surprising example is a wave with corners. A square wave jumps from −1 to +1 and back, and holds still between jumps, yet it is a sum of smooth sine waves:

sq(x) = 4π ( sin x + sin 3x3 + sin 5x5 + sin 7x7 + … )(3.2)
Figure 5 Add sine waves one at a time with the slider. The gray step is the square wave; the vermilion curve is the sum so far; the blue curve is the newest wave on its own, with three, five, seven… times the frequency and a third, a fifth, a seventh… of the height. Watch the flat parts fill in, and watch the spike beside each jump.#

With one term the “square wave” is just a sine wave, a little taller than the steps (4/π ≈ 1.27). Each new term is a faster, smaller wave that pushes the sum toward the steps in some places and away in others, and with a few dozen terms the flat parts are flat to within a few percent. Next to each jump, though, something stubborn happens. The sum overshoots, and adding more terms makes the spike narrower without making it shorter. Its height settles at about 1.179, an overshoot of almost 9% of the size of the jump. The number has a closed form, (2/π) times the integral of sin t/t from 0 to π, and the effect is called the Gibbs phenomenon after Josiah Willard Gibbs, who wrote about it in Nature in 1899[10]. established

Fourier’s idea is why the sine wave matters so much more than its humble origin suggests. A sound recording, a radio signal, a heartbeat and the height of the tide can all be taken apart into turning circles of different speeds, and each part can be understood, filtered or predicted on its own. The unit circle on the first page of this site is the building block of all of it.

Waves are where the circle shows up in physics. The next chapter goes back to the circle itself and uses it to prove the trigonometric identities, the rules that let you rewrite one of these waves as a combination of others.