Monocurl Essays
Series Download

Why the derivative of sine is cosine

Nudge a point around the unit circle and a tiny triangle appears, similar to the big one. Its legs are the derivatives of sine and cosine.

20 min·High school·

AssumesWhat is a derivative? Speed at a single instantThe product rule and the chain rule, seen

A point travels once around a circle of radius 1. Its height above the center, plotted against the distance it has traveled along the circle, is the graph of $\sin\theta$.
Monocurl source
let HC = [-2.45, 0, 0]
let HR = 1.25
let fw = Frame(0, 6.6, -1.2, 1.2, [1.5, 0, 0], 4.2, 3.0)
mesh grid = GridLines(fw, [PI / 2, PI, 3 * PI / 2, 2 * PI], [-1, 1])
mesh axes = [
    Axes(fw),
    YTicks(fw, [-1, 1]),
    center{[fx(fw, PI) - 0.25, fy(fw, 0) - 0.33, 0]} Math("\pi", 0.8, SLATE),
    center{[fx(fw, 2 * PI) - 0.3, fy(fw, 0) + 0.36, 0]} Math("2\pi", 0.8, SLATE),
    center{[fx(fw, 6.6) + 0.3, fy(fw, 0) - 0.36, 0]} Math("\theta", 0.85, SLATE),
    Seg([HC[0] - HR - 0.12, 0, 0], [HC[0] + HR + 0.12, 0, 0], SLATE, 2),
    Seg([HC[0], -HR - 0.2, 0], [HC[0], HR + 0.2, 0], SLATE, 2),
    ArcPath(HC, HR, 0, 2 * PI, SLATE, 2.5),
    center{[fx(fw, PI / 2) + 1.0, fy(fw, 1) - 0.1, 0]} Math("\sin\theta", 0.9, EMBER)
]
let Turn = |t| {
    let p = pol(HC, HR, t)
    let n = to_int(max(2, ceil(t * 14)))
    return [
        Seg(p, at(fw, t, sin(t)), MIST, 2),
        ArcPath(HC, HR, 0, t, LEAF, 5),
        Seg(HC, p, INK, 2.5),
        Seg([p[0], 0, 0], p, EMBER, 5),
        stroke{EMBER, 4} Polyline(map(sample(0, t, n), |v| at(fw, v, sin(v)))),
        Seg(at(fw, 0, -1.2), at(fw, t, -1.2), LEAF, 5),
        Pt(at(fw, t, sin(t)), EMBER, 0.085),
        Pt(p, INK, 0.085)
    ]
}
mesh turn = Turn(t: 0.05)

slide "turn"
    play Wait(0.6)
    turn.t = 2 * PI
    play Lerp(6, [&turn], linear)
    play Wait(1.4)

Uses the shared definitions for this lesson's figures.

A point moves around a circle of radius 1 at a steady pace, starting from the rightmost position. Its height above the center goes up, levels off at the top, comes down, and repeats. When is that height changing fastest, and how fast?

The height of the point after it has turned through an angle $\theta$ is $\sin\theta$, so the question is asking for the derivative of the sine function. None of the rules we have can produce it. Sine is not a power of $\theta$, nor a sum, product or chain of powers, so the power rule and the product and chain rules have nothing to hold on to. We have to go back to the definition, and the definition immediately asks for something awkward: the limit of $\frac{\sin(\theta + h) - \sin\theta}{h}$, where the $h$ is locked inside a sine and cannot be cancelled by algebra.

The way through is to stop treating $\sin$ as a formula and return to what it measures. On the circle, the answer can be seen in one small triangle. After that we will prove it.

What sine and cosine are, and how the angle is measured

Draw the circle of radius 1 centered at the origin, the unit circle. Start at the point $(1, 0)$ and travel counterclockwise along the circle. After turning through an angle $\theta$ you are at a point whose coordinates are, by definition, $(\cos\theta, \sin\theta)$: cosine is the horizontal position and sine is the height. (The lesson on the unit circle builds this definition from right triangles.)

The angle will be measured in radians, which means that $\theta$ is the length of the arc you have traveled along the unit circle. A full turn is the whole circumference, $2\pi$; a quarter turn is $\frac{\pi}{2} \approx 1.571$; and $60°$ is $\frac{\pi}{3} \approx 1.047$. In the animation above, the green arc on the circle and the green segment under the graph have the same length, and that is the definition at work. The choice of unit will decide the answer, and near the end we will see what happens with degrees. (The lesson on radians introduces the unit from scratch.)

Finally, recall the definition we are working from. The derivative of a function $f$ at a point $a$ is the limit of the difference quotient,

$$ f'(a) = \lim_{h \to 0} \frac{f(a+h) - f(a)}{h}, $$

the change in the output divided by the change in the input, as the change in the input shrinks to zero (lesson 1).

Pause and try

Before any computation, use the animation to predict. At which positions on the circle is the height of the point changing fastest as $\theta$ increases? At which positions is it momentarily not changing at all? Where is the height decreasing?

Show answerHide answer

The height changes fastest where the point is moving straight up or straight down, which is at the far right ($\theta = 0$) and the far left ($\theta = \pi$). It is momentarily not changing at the top ($\theta = \frac{\pi}{2}$) and the bottom ($\theta = \frac{3\pi}{2}$), where the motion is horizontal. It decreases on the whole left half of the trip, from $\frac{\pi}{2}$ to $\frac{3\pi}{2}$. So the derivative of sine should be largest at 0, zero at $\frac{\pi}{2}$, and negative after that.

The numbers first

A calculator in radian mode can compute difference quotients even though algebra cannot simplify them. Here they are at four angles in the first quarter turn, for three values of $h$.

$\theta$$h = 0.1$$h = 0.01$$h = 0.001$
$0$$0.9983$$1.0000$$1.0000$
$\pi/6$$0.8396$$0.8635$$0.8658$
$\pi/3$$0.4559$$0.4957$$0.4996$
$\pi/2$$-0.0500$$-0.0050$$-0.0005$

Each entry is $\frac{\sin(\theta + h) - \sin\theta}{h}$, rounded to four places. For instance, at $\theta = \frac{\pi}{3}$ with $h = 0.01$, $\sin\left(\frac{\pi}{3} + 0.01\right) \approx 0.870982$ and $\sin\frac{\pi}{3} \approx 0.866025$, and their difference divided by $0.01$ is $0.4957$.

Along each row the values settle. The limits look like $1$, about $0.866$, $0.5$ and $0$. This matches the prediction: largest at the right-hand side of the circle, zero at the top. And the four numbers are familiar. They are $\cos 0$, $\cos\frac{\pi}{6} = \frac{\sqrt 3}{2} \approx 0.8660$, $\cos\frac{\pi}{3} = \frac{1}{2}$ and $\cos\frac{\pi}{2} = 0$.

So the data suggest that the derivative of $\sin\theta$ is $\cos\theta$. A table cannot say why the rate of change of the height should equal the horizontal coordinate, of all things. The circle can.

A nudge along the circle

Put the point at angle $\theta$, and increase the angle by a small amount, which I will call $d\theta$ in the pictures. Two facts about the resulting motion do all the work.

The first is that the point moves a distance $d\theta$. That is what radians mean: on the unit circle, the arc traveled is the change in angle.

The second is the direction of the motion. A point on a circle moves at right angles to the radius that reaches it. The radius to our point makes an angle $\theta$ with the horizontal. Rotate both of those lines by a quarter turn: the radius becomes the direction of motion, and the horizontal becomes the vertical. So the direction of motion makes the same angle $\theta$ with the vertical.

Now split the small displacement into a vertical part and a horizontal part. The vertical part is the change in height, which is the change in $\sin\theta$ that we are after.

  1. A point on the unit circle at angle θ. Its horizontal position is cos θ and its height is sin θ.
  2. Increase the angle by dθ. The point moves along the green arc, whose length is dθ.
  3. Zoom in on the arc. Split the motion into a vertical part (orange) and a horizontal part (blue).
  4. The motion is at right angles to the radius, so it makes the angle θ with the vertical.
  5. So the small triangle has the angles of the large one. Its hypotenuse is dθ, and its legs are cos θ · dθ and sin θ · dθ.
  6. Make dθ four times smaller and zoom in four times further. The arc is now nearly straight, and the triangle is nearly exact.
Zooming in on a point of the unit circle as its angle increases by $d\theta$. The short arc it travels becomes the hypotenuse of a small right triangle that has the same angles as the large triangle with sides $\cos\theta$, $\sin\theta$ and 1.
Monocurl source
let ZO = [-1.3, -1.6, 0]
let ZR = 3.3
let TH = PI / 3
let P0 = pol(ZO, ZR, TH)
let ZC = [1.0, -0.3, 0]
let zt = |k, u, p| {
    let c = mix(P0, ZC, u)
    return [c[0] + k * (p[0] - P0[0]), c[1] + k * (p[1] - P0[1]), 0]
}
let View = |k, u, d| {
    let w = 7 / (ZR * k)
    let a = max(0, TH - w)
    let b = min(PI / 2, TH + d + w)
    let foot = [P0[0], ZO[1], 0]
    let na = to_int(max(1, min(12, ceil(d * ZR * k / 0.05))))
    return [
        Seg(zt(k, u, ZO), zt(k, u, [ZO[0] + ZR + 0.35, ZO[1], 0]), SLATE, 2.5),
        Seg(zt(k, u, ZO), zt(k, u, [ZO[0], ZO[1] + ZR + 0.35, 0]), SLATE, 2.5),
        stroke{SLATE, 3} Polyline(map(sample(a, b, 60), |t| zt(k, u, pol(ZO, ZR, t)))),
        Seg(zt(k, u, ZO), zt(k, u, pol(ZO, ZR, TH + d)), SLATE, 2),
        Seg(zt(k, u, ZO), zt(k, u, P0), INK, 3),
        Seg(zt(k, u, ZO), zt(k, u, foot), AZURE, 4.5),
        Seg(zt(k, u, foot), zt(k, u, P0), EMBER, 4.5),
        stroke{LEAF, 6} Polyline(map(sample(TH, TH + d, na), |t| zt(k, u, pol(ZO, ZR, t)))),
        Pt(zt(k, u, pol(ZO, ZR, TH + d)), LEAF, 0.085),
        Pt(zt(k, u, P0), INK, 0.09)
    ]
}
# the small triangle: up from the old point, then across to the new one
let Tri = |k, u, d| {
    let p = zt(k, u, P0)
    let q = zt(k, u, pol(ZO, ZR, TH + d))
    return [
        Seg(p, [p[0], q[1], 0], EMBER, 5),
        Seg([p[0], q[1], 0], q, AZURE, 5)
    ]
}
let Marks = |k, u, d| {
    let p = zt(k, u, P0)
    let s = 0.26
    let ur = [-cos(TH), -sin(TH), 0]
    let vt = [-sin(TH), cos(TH), 0]
    return [
        stroke{INK, 2.5} Polyline([
            [p[0] + s * ur[0], p[1] + s * ur[1], 0],
            [p[0] + s * (ur[0] + vt[0]), p[1] + s * (ur[1] + vt[1]), 0],
            [p[0] + s * vt[0], p[1] + s * vt[1], 0]
        ]),
        ArcPath(p, 0.75, PI / 2, PI / 2 + TH, INK, 2.5),
        center{pol(p, 1.05, PI / 2 + TH / 2)} Math("\theta", 0.9, INK)
    ]
}
let Legs = |k, u, d| {
    let p = zt(k, u, P0)
    let q = zt(k, u, pol(ZO, ZR, TH + d))
    return [
        center{[p[0] + 1.15, (p[1] + q[1]) / 2, 0]} Math("\cos\theta \cdot d\theta", 0.9, EMBER),
        center{[(p[0] + q[0]) / 2, q[1] + 0.36, 0]} Math("\sin\theta \cdot d\theta", 0.9, AZURE),
        center{[(p[0] + q[0]) / 2 - 0.45, (p[1] + q[1]) / 2 - 0.5, 0]} Math("d\theta", 0.95, LEAF)
    ]
}
mesh view = View(k: 1, u: 0, d: 0.002)
mesh tri = []
mesh marks = []
mesh legs = []
mesh names = [
    ArcPath(ZO, 0.6, 0, TH, INK, 2.5),
    center{pol(ZO, 0.95, TH / 2)} Math("\theta", 0.9, INK),
    center{[(ZO[0] + P0[0]) / 2 + 0.3, (ZO[1] + P0[1]) / 2 - 0.1, 0]} Math("1", 0.9, INK),
    center{[(ZO[0] + P0[0]) / 2, ZO[1] - 0.36, 0]} Math("\cos\theta", 0.9, AZURE),
    center{[P0[0] + 0.62, (ZO[1] + P0[1]) / 2, 0]} Math("\sin\theta", 0.9, EMBER)
]
mesh arcname = []

slide "A point on the unit circle at angle θ. Its horizontal position is cos θ and its height is sin θ."
    play Fade(0.6)

slide "Increase the angle by dθ. The point moves along the green arc, whose length is dθ."
    view.d = 0.2
    play Lerp(1.4, [&view])
    arcname = center{pol(ZO, ZR + 0.42, TH + 0.1)} Math("d\theta", 0.95, LEAF)
    play Fade(0.4, [&arcname])

slide "Zoom in on the arc. Split the motion into a vertical part (orange) and a horizontal part (blue)."
    names = []
    arcname = []
    play Fade(0.3, [&names, &arcname])
    view.k = 6
    view.u = 1
    play Lerp(2.2, [&view])
    tri = Tri(k: 6, u: 1, d: 0.2)
    play Fade(0.5, [&tri])

slide "The motion is at right angles to the radius, so it makes the angle θ with the vertical."
    marks = Marks(k: 6, u: 1, d: 0.2)
    play Fade(0.5, [&marks])

slide "So the small triangle has the angles of the large one. Its hypotenuse is dθ, and its legs are cos θ · dθ and sin θ · dθ."
    legs = Legs(k: 6, u: 1, d: 0.2)
    play Fade(0.5, [&legs])

slide "Make dθ four times smaller and zoom in four times further. The arc is now nearly straight, and the triangle is nearly exact."
    view.k = 24
    view.d = 0.05
    tri.k = 24
    tri.d = 0.05
    marks.k = 24
    marks.d = 0.05
    legs.k = 24
    legs.d = 0.05
    play Lerp(2.4, [&view, &tri, &marks, &legs])

Uses the shared definitions for this lesson's figures.

Look at the small triangle in the last frames. Its hypotenuse is the path of the point, of length $d\theta$. The angle at its lower corner, between the vertical leg and the hypotenuse, is $\theta$. A right triangle with hypotenuse $d\theta$ and an angle $\theta$ has a leg of length $\cos\theta \cdot d\theta$ next to that angle and a leg of length $\sin\theta \cdot d\theta$ opposite it. It is the large triangle of the first frame, with sides $\cos\theta$, $\sin\theta$ and 1, shrunk by the factor $d\theta$ and turned a quarter turn, so that the side that was horizontal in the large triangle is vertical in the small one.

Pause and try

The vertical leg of the small triangle is $\cos\theta \cdot d\theta$ and the horizontal leg is $\sin\theta \cdot d\theta$. Check that it is this way round, and not the reverse, by testing the two extreme positions $\theta = 0$ and $\theta = \frac{\pi}{2}$. Then read off from the triangle how $\cos\theta$ changes when $\theta$ increases by $d\theta$, including the sign.

Show answerHide answer

At $\theta = 0$ the point is at the far right and moving straight up, so the whole displacement should be vertical: $\cos 0 \cdot d\theta = d\theta$ and $\sin 0 \cdot d\theta = 0$, as required. At $\theta = \frac{\pi}{2}$ the point is at the top and moving horizontally, and indeed the vertical leg is $\cos\frac{\pi}{2} \cdot d\theta = 0$. For the cosine: $\cos\theta$ is the horizontal position, and the horizontal leg has length $\sin\theta \cdot d\theta$, but the point is moving to the left, so the horizontal position decreases. The change in $\cos\theta$ is $-\sin\theta \cdot d\theta$.

The vertical leg is the change in height, so the change in $\sin\theta$ is approximately $\cos\theta \cdot d\theta$, and dividing by $d\theta$ gives the rate.

The first quarter turn is not special. The next animation follows the point all the way around, with its velocity drawn as an arrow and split into the same two parts.

A point moving around the unit circle at one radian per unit of time. Its velocity has length 1 and is perpendicular to the radius. The vertical part of the velocity is $\cos\theta$ and the horizontal part is $-\sin\theta$, in every quadrant.
Monocurl source
let VC = [-1.6, 0, 0]
let VR = 1.55
let VL = 1.15
mesh base = [
    Seg([VC[0] - VR - 0.3, 0, 0], [VC[0] + VR + 0.3, 0, 0], SLATE, 2),
    Seg([VC[0], -VR - 0.3, 0], [VC[0], VR + 0.3, 0], SLATE, 2),
    ArcPath(VC, VR, 0, 2 * PI, SLATE, 3),
    center{[2.45, 1.55, 0]} Math("\theta", 0.9, SLATE),
    center{[2.45, 0.45, 0]} Cap("vertical part", 0.76, EMBER),
    center{[2.45, -0.75, 0]} Cap("horizontal part", 0.76, AZURE)
]
let Part = |a, b, col| {
    var out = []
    if (abs(b[0] - a[0]) + abs(b[1] - a[1]) > 0.2) {
        out = Tip(a, b, col, 4.5, 0.18)
    } else {
        out = Seg(a, [b[0] + 0.002, b[1] + 0.002, 0], col, 4.5)
    }
    return out
}
let Spin = |t| {
    let p = pol(VC, VR, t)
    return [
        Seg(VC, p, INK, 2.5),
        Tip(p, [p[0] - VL * sin(t), p[1] + VL * cos(t), 0], SLATE, 2.5, 0.16),
        Part(p, [p[0], p[1] + VL * cos(t), 0], EMBER),
        Part(p, [p[0] - VL * sin(t), p[1], 0], AZURE),
        Pt(p, INK, 0.09),
        center{[2.45, 1.1, 0]} scale{1.3} color{INK} Number(t, 2),
        center{[2.45, 0.0, 0]} scale{1.4} color{EMBER} Number(cos(t), 2),
        center{[2.45, -1.2, 0]} scale{1.4} color{AZURE} Number(0 - sin(t), 2)
    ]
}
mesh spin = Spin(t: 0.02)

slide "spin"
    play Wait(0.6)
    spin.t = 2 * PI
    play Lerp(8, [&spin], linear)
    play Wait(1.2)

Uses the shared definitions for this lesson's figures.

What the picture leaves out

The triangle argument is convincing, and it is the right way to remember the result, but it is not yet a proof. It treated a short arc of the circle as if it were a straight segment. For any actual $d\theta$ that is false: the arc bends, the chord joining its ends is a little shorter than the arc, and the chord’s direction is not exactly perpendicular to the radius at the starting point. The claim hidden in the picture is that all of these discrepancies become negligible relative to $d\theta$ as $d\theta \to 0$, and a claim of that kind is a statement about a limit. It has to be proved.

To see exactly which limits are involved, expand the difference quotient with the angle addition formula $\sin(\alpha + \beta) = \sin\alpha\cos\beta + \cos\alpha\sin\beta$. This formula is a theorem of trigonometry, proved in that lesson for all real angles, and we use it here without repeating the proof; it expresses what happens to the coordinates of a point on the circle when it is rotated through a further angle. With $\alpha = \theta$ and $\beta = h$,

$$ \frac{\sin(\theta + h) - \sin\theta}{h} = \frac{\sin\theta\cos h + \cos\theta\sin h - \sin\theta}{h} = \cos\theta \cdot \frac{\sin h}{h} + \sin\theta \cdot \frac{\cos h - 1}{h}. $$

The angle $\theta$ is fixed, so everything depends on two limits that have nothing to do with $\theta$:

$$ \lim_{h \to 0} \frac{\sin h}{h} \qquad \text{and} \qquad \lim_{h \to 0} \frac{\cos h - 1}{h}. $$

If the first is 1 and the second is 0, the difference quotient has limit $\cos\theta$, as the picture says. These two limits are themselves the picture at $\theta = 0$. The first says that for a point just above $(1, 0)$, the height $\sin h$ and the arc $h$ are nearly equal: the arc is nearly a vertical segment. The second says that its horizontal position has barely changed.

Pause and try

With a calculator in radian mode, compute $\frac{\sin h}{h}$ and $\frac{\cos h - 1}{h}$ for $h = 0.5$, $0.1$ and $0.01$. Do the values support the two limits? Roughly how does the second quotient depend on $h$?

Show answerHide answer

$\frac{\sin h}{h}$ is $0.9589$, $0.9983$, $0.99998$, approaching 1. $\frac{\cos h - 1}{h}$ is $-0.2448$, $-0.0500$, $-0.0050$, approaching 0. The second quotient is close to $-\frac{h}{2}$, which is a sign that $1 - \cos h$ is about $\frac{h^2}{2}$: small in the second order, like the corner of the growing square in the power rule lesson.

The limit of sin h over h

Both limits follow from one comparison of three lengths. For an angle $h$ between 0 and $\frac{\pi}{2}$, draw the arc of the unit circle from $A = (1, 0)$ to $P = (\cos h, \sin h)$, and extend the radius through $P$ until it meets the vertical line through $A$ at a point $T$. Since $T$ lies on the line through the origin with slope $\frac{\sin h}{\cos h}$, its height is $\tan h = \frac{\sin h}{\cos h}$.

  1. The triangle OAP has base 1 and height sin h, so its area is half of sin h.
  2. The sector of the circle between the two radii contains that triangle. A sector of angle h is the fraction h/2π of a disk of area π, so its area is half of h.
  3. Extend the radius to T on the vertical line through A. The triangle OAT contains the sector, and its area is half of tan h.
  4. Each region sits inside the next, so the areas are in order. Doubling them: sin h < h < tan h.
Three nested regions for an angle $h$ of 0.8 radians: the triangle with vertex on the circle, the circular sector, and the triangle that reaches the tangent line. Comparing their areas gives $\sin h < h < \tan h$.
Monocurl source
let QO = [-3.3, -1.55, 0]
let QR = 3.2
let H = 0.8
let A = pol(QO, QR, 0)
let P = pol(QO, QR, H)
let T = [A[0], QO[1] + QR * sin(H) / cos(H), 0]
let sector = block {
    . QO
    for (t in sample(0, H, 40)) {
        . pol(QO, QR, t)
    }
}
mesh outer = []
mesh wedge = []
mesh inner = Region([QO, A, P], tint(EMBER, 0.38))
mesh lines = [
    Seg(QO, [A[0] + 0.4, A[1], 0], SLATE, 2.5),
    ArcPath(QO, QR, 0, 1.2, SLATE, 2.5),
    Seg(QO, P, INK, 2.5),
    Seg(A, P, EMBER, 2.5),
    Seg([P[0], QO[1], 0], P, EMBER, 4.5),
    ArcPath(QO, 0.7, 0, H, INK, 2.5),
    center{pol(QO, 1.0, H / 2)} Math("h", 0.9, INK),
    center{[(QO[0] + A[0]) / 2, QO[1] - 0.33, 0]} Math("1", 0.85, SLATE),
    center{[P[0] - 0.45, (QO[1] + P[1]) / 2 - 0.2, 0]} Math("\sin h", 0.8, EMBER),
    Pt(P, INK, 0.08),
    Pt(A, INK, 0.08),
    center{[P[0] - 0.1, P[1] + 0.32, 0]} Math("P", 0.8, INK),
    center{[A[0] + 0.1, A[1] - 0.33, 0]} Math("A", 0.8, INK)
]
mesh extra = []
mesh r1 = center{[2.2, 1.2, 0]} Math(str_join(["\tfrac12 \sin h = ", to_string(sin(H) / 2, 3)]), 0.9, EMBER)
mesh r2 = []
mesh r3 = []
mesh r4 = []

slide "The triangle OAP has base 1 and height sin h, so its area is half of sin h."
    play Fade(0.6)

slide "The sector of the circle between the two radii contains that triangle. A sector of angle h is the fraction h/2π of a disk of area π, so its area is half of h."
    wedge = Region(sector, tint(LEAF, 0.3))
    extra = ArcPath(QO, QR, 0, H, LEAF, 5)
    r2 = center{[2.2, 0.4, 0]} Math(str_join(["\tfrac12 h = ", to_string(H / 2, 3)]), 0.9, LEAF)
    play Fade(0.6, [&wedge, &extra, &r2])

slide "Extend the radius to T on the vertical line through A. The triangle OAT contains the sector, and its area is half of tan h."
    outer = Region([QO, A, T], tint(AZURE, 0.3))
    extra = [
        ArcPath(QO, QR, 0, H, LEAF, 5),
        Seg(P, T, INK, 2.5),
        Seg(A, T, AZURE, 4.5),
        Pt(T, INK, 0.08),
        center{[T[0] + 0.3, T[1], 0]} Math("T", 0.8, INK),
        center{[A[0] + 0.55, (A[1] + T[1]) / 2, 0]} Math("\tan h", 0.8, AZURE)
    ]
    r3 = center{[2.2, -0.4, 0]} Math(str_join(["\tfrac12 \tan h = ", to_string(sin(H) / cos(H) / 2, 3)]), 0.9, AZURE)
    play Fade(0.6, [&outer, &extra, &r3])

slide "Each region sits inside the next, so the areas are in order. Doubling them: sin h < h < tan h."
    r4 = center{[2.2, -1.3, 0]} Math("\sin h < h < \tan h", 0.95)
    play Fade(0.5, [&r4])

Uses the shared definitions for this lesson's figures.

The proof rests on two facts from geometry: that the unit disk has area $\pi$, and that a sector’s area is proportional to its angle measured in radians (both are in the lesson on radians, which states the sector formula $\frac{1}{2}r^2\theta$). Those are where the definition of radians enters the argument. Neither fact involves a derivative, so the argument is not circular: nothing below uses the derivative of sine to find the limit that the derivative of sine depends on.

As the angle $h$ shrinks, the height $\sin h$ (orange), the arc $h$ (green) and the tangent segment $\tan h$ (blue) become indistinguishable, and the ratio $\sin h / h$ approaches 1.
Monocurl source
let QO = [-3.3, -1.55, 0]
let QR = 3.2
let A = pol(QO, QR, 0)
mesh base = [
    Seg(QO, [A[0] + 0.4, A[1], 0], SLATE, 2.5),
    ArcPath(QO, QR, 0, 1.2, SLATE, 2.5),
    center{[2.4, 1.72, 0]} Math("\sin h", 0.85, EMBER),
    center{[2.4, 0.78, 0]} Math("h", 0.85, LEAF),
    center{[2.4, -0.16, 0]} Math("\tan h", 0.85, AZURE),
    center{[2.4, -1.1, 0]} Math("\sin h \div h", 0.85, INK)
]
let Squeeze = |h| {
    let p = pol(QO, QR, h)
    let t = [A[0], QO[1] + QR * sin(h) / cos(h), 0]
    return [
        Seg(QO, t, INK, 2),
        Seg(A, t, AZURE, 5),
        ArcPath(QO, QR, 0, h, LEAF, 5),
        Seg([p[0], QO[1], 0], p, EMBER, 5),
        Pt(p, INK, 0.075),
        center{[2.4, 1.3, 0]} scale{1.25} color{EMBER} Number(sin(h), 4),
        center{[2.4, 0.36, 0]} scale{1.25} color{LEAF} Number(h, 4),
        center{[2.4, -0.58, 0]} scale{1.25} color{AZURE} Number(sin(h) / cos(h), 4),
        center{[2.4, -1.55, 0]} scale{1.4} color{INK} Number(sin(h) / h, 4)
    ]
}
mesh squeeze = Squeeze(h: 0.8)

slide "squeeze"
    play Wait(0.8)
    squeeze.h = 0.2
    play Lerp(6, [&squeeze])
    play Wait(1.4)

Uses the shared definitions for this lesson's figures.

The theorem

We have now seen a proof, with three ingredients taken from trigonometry and geometry and named as such: the angle addition formula, the double-angle identity, and the area of a sector. Every clause of the theorem was needed, including the one that is easiest to skim past, “measured in radians”.

The same fact on the graphs

On the graph of $\sin\theta$, the derivative is the slope of the tangent line. The next figure draws the two graphs with the same scale on both axes, so that a slope of 1 is a line at $45°$.

A tangent line rides along the graph of $\sin\theta$ (top). Its slope at each point, plotted below, traces out the graph of $\cos\theta$. The grid squares are $\pi/2$ wide and 1 tall, drawn to the same scale on both axes.
Monocurl source
let fs = Frame(0, 6.6, -1.05, 1.05, [-0.59, 1.16, 0], 5.016, 1.596)
let fc = Frame(0, 6.6, -1.05, 1.05, [-0.59, -0.7, 0], 5.016, 1.596)
let qs = [PI / 2, PI, 3 * PI / 2, 2 * PI]
let PanelAxes = |f| [
    Seg(at(f, 0, -1.05), at(f, 0, 1.05), SLATE, 2.5),
    Tip(at(f, 0, 0), [fx(f, 6.6) + 0.22, fy(f, 0), 0], SLATE, 2.5, 0.15),
    map([-1, 1], |y| [
        Seg([fx(f, 0) - 0.07, fy(f, y), 0], [fx(f, 0) + 0.07, fy(f, y), 0], SLATE, 2),
        center{[fx(f, 0) - 0.38, fy(f, y), 0]} Math(to_string(y, 0), 0.8, SLATE)
    ])
]
let XLabel = |x, tex| center{[fx(fc, x), fy(fc, -1.05) - 0.33, 0]} Math(tex, 0.82, SLATE)
mesh grid = [GridLines(fs, qs, [-1, 1]), GridLines(fc, qs, [-1, 1])]
mesh axes = [
    PanelAxes(fs),
    PanelAxes(fc),
    XLabel(0, "0"),
    XLabel(PI / 2, "\pi/2"),
    XLabel(PI, "\pi"),
    XLabel(3 * PI / 2, "3\pi/2"),
    XLabel(2 * PI, "2\pi"),
    center{[fx(fc, 6.6) + 0.5, fy(fc, -1.05) - 0.33, 0]} Math("\theta", 0.85, SLATE),
    center{[2.95, 1.16, 0]} Math("\sin\theta", 0.95, EMBER),
    center{[2.95, -0.3, 0]} Cap("slope", 0.8, AZURE)
]
mesh wave = Graph(fs, |t| sin(t), 0, 6.5, EMBER, 4)
let Ride = |t| {
    let m = cos(t)
    let r = 0.85 / sqrt(1 + m * m)
    let n = to_int(max(2, ceil(t * 14)))
    return [
        Seg(at(fs, t, sin(t)), at(fc, t, m), MIST, 2),
        Seg(at(fs, t - r, sin(t) - m * r), at(fs, t + r, sin(t) + m * r), INK, 3.5),
        Pt(at(fs, t, sin(t)), INK, 0.085),
        stroke{AZURE, 4} Polyline(map(sample(0, t, n), |v| at(fc, v, cos(v)))),
        Pt(at(fc, t, m), AZURE, 0.085),
        center{[2.95, -0.85, 0]} scale{1.4} color{AZURE} Number(m, 2)
    ]
}
mesh ride = Ride(t: 0.05)

slide "ride"
    play Wait(0.6)
    ride.t = 6.4
    play Lerp(7, [&ride], linear)
    play Wait(1.4)

Uses the shared definitions for this lesson's figures.

At $\theta = 0$ the sine curve leaves the origin at $45°$, slope 1. At its crest the tangent is level, slope 0, and the cosine curve crosses the axis. Where sine is falling most steeply, at $\theta = \pi$, the cosine is at its lowest, $-1$.

Why radians matter

Suppose the angle is measured in degrees instead. Write $S(x)$ for the sine of $x$ degrees. Since $x$ degrees is $\frac{\pi x}{180}$ radians, $S(x) = \sin\left(\frac{\pi x}{180}\right)$, and the chain rule gives

$$ S'(x) = \frac{\pi}{180}\cos\left(\frac{\pi x}{180}\right) \approx 0.01745 \times (\text{cosine of } x \text{ degrees}). $$

The derivative of sine-in-degrees is not cosine-in-degrees. It carries a factor of $\frac{\pi}{180}$, because a nudge of one degree moves the point only $\frac{\pi}{180}$ of a unit along the circle. You can check this numerically: the sine of $60.1°$ minus the sine of $60°$ is about $0.000871$, which is $0.00871$ per degree, close to $0.01745 \times 0.5 = 0.00873$.

The sine of x plotted against the number x, once with x in radians and once with x in degrees. In radians the graph leaves the origin with slope 1. In degrees its slope there is \pi/180, about 0.017.
The sine of $x$ plotted against the number $x$, once with $x$ in radians and once with $x$ in degrees. In radians the graph leaves the origin with slope 1. In degrees its slope there is $\pi/180$, about 0.017.
Monocurl source
let fd = Frame(0, 7, -1.2, 1.2, [-0.15, 0, 0], 6.4, 3.3)
mesh grid = GridLines(fd, [1, 2, 3, 4, 5, 6, 7], [-1, -0.5, 0.5, 1])
mesh axes = [
    Axes(fd, "x"),
    map([1, 2, 3, 4, 5, 6, 7], |x| center{[fx(fd, x), fy(fd, -1.2) - 0.3, 0]} Math(to_string(x), 0.75, SLATE)),
    YTicks(fd, [-1, 1])
]
mesh rad = Graph(fd, |x| sin(x), 0, 7, EMBER, 4)
mesh deg = Graph(fd, |x| sin(PI * x / 180), 0, 7, PLUM, 4)
mesh labels = [
    center{at(fd, 3.2, 0.95)} Cap("x in radians", 0.76, EMBER),
    center{at(fd, 5.2, 0.38)} Cap("x in degrees", 0.76, PLUM)
]

Uses the shared definitions for this lesson's figures.

What to keep

The difficulty this time was that the difference quotient of sine could not be simplified by algebra, so the method of the earlier lessons had nowhere to start. What replaced it was geometry: a nudge of the angle moves the point a known distance in a known direction, and the two parts of that motion are the two derivatives. Making the picture into a proof took one honest inequality, $\sin h < h < \tan h$, which says that a short arc is trapped between two straight segments that are nearly the same length.

One consequence is worth carrying forward. Differentiating sine twice gives $\sin'' = (\cos)' = -\sin$: the sine function is the negative of its own second derivative, and the same is true of cosine. That property is why these functions appear whenever something oscillates.

Check yourself

What is the derivative of $\cos(2x)$ at $x = \frac{\pi}{4}$?

Problems

Work these on paper before opening the solutions. A calculator is needed only where a problem says so. The first three are direct, the next two combine this lesson with earlier rules, and the last two extend it.

Problem 1

Differentiate $f(x) = 3\sin x - 2\cos x$, and evaluate $f'(\pi)$.

Show solutionHide solution

Term by term, $f'(x) = 3\cos x - 2(-\sin x) = 3\cos x + 2\sin x$. At $x = \pi$, $\cos\pi = -1$ and $\sin\pi = 0$, so $f'(\pi) = -3$.

Problem 2

Find the tangent line to $y = \cos x$ at $x = \frac{\pi}{2}$, and use it to estimate $\cos(1.6)$. Compare with a calculator.

Show solutionHide solution

The point is $\left(\frac{\pi}{2}, 0\right)$ and the slope is $-\sin\frac{\pi}{2} = -1$, so the tangent line is $y = -\left(x - \frac{\pi}{2}\right) = \frac{\pi}{2} - x$. At $x = 1.6$ it gives $1.5708 - 1.6 = -0.0292$. A calculator gives $\cos(1.6) \approx -0.02920$, the same to four places. The agreement is unusually good because the cosine curve has no bend at this point: it is passing from curving one way to curving the other.

Problem 3

Differentiate (a) $\sin(x^2)$; (b) $\cos(3x + 1)$; (c) $\sin^3 x$.

Show solutionHide solution

(a) Outer function $\sin u$, inner $u = x^2$: the derivative is $\cos(x^2) \cdot 2x = 2x\cos(x^2)$. (b) Outer $\cos u$, inner $u = 3x + 1$: $-\sin(3x+1) \cdot 3 = -3\sin(3x + 1)$. (c) Outer $u^3$, inner $u = \sin x$: $3\sin^2 x \cdot \cos x$.

Problem 4

Find every $x$ in the interval $[0, 2\pi]$ at which the graph of $f(x) = \sin x + \cos x$ has a horizontal tangent line, and the value of $f$ at each.

Show solutionHide solution

$f'(x) = \cos x - \sin x$, which is zero when $\sin x = \cos x$. On the unit circle that happens where the two coordinates are equal, on the line $y = x$: at $x = \frac{\pi}{4}$, where both are $\frac{\sqrt2}{2}$, and at $x = \frac{5\pi}{4}$, where both are $-\frac{\sqrt2}{2}$. The values are $f\left(\frac{\pi}{4}\right) = \sqrt2 \approx 1.414$ and $f\left(\frac{5\pi}{4}\right) = -\sqrt2$. These are the highest and lowest points of the graph.

Problem 5

Show that the derivative of $\tan x = \dfrac{\sin x}{\cos x}$ is $\dfrac{1}{\cos^2 x}$ wherever $\cos x \neq 0$. Write $\tan x$ as the product $\sin x \cdot (\cos x)^{-1}$ and use the product and chain rules.

Show solutionHide solution

The factor $(\cos x)^{-1}$ is a chain with outer function $u^{-1}$, whose derivative is $-u^{-2}$, and inner function $\cos x$, whose derivative is $-\sin x$. So its derivative is $-(\cos x)^{-2} \cdot (-\sin x) = \frac{\sin x}{\cos^2 x}$. By the product rule,

$$ (\tan x)' = \cos x \cdot \frac{1}{\cos x} + \sin x \cdot \frac{\sin x}{\cos^2 x} = 1 + \frac{\sin^2 x}{\cos^2 x} = \frac{\cos^2 x + \sin^2 x}{\cos^2 x} = \frac{1}{\cos^2 x}. $$

The derivative is positive wherever it exists, so the tangent function increases on each interval between its vertical asymptotes.

Problem 6

Prove that $\displaystyle\lim_{h \to 0} \frac{1 - \cos h}{h^2} = \frac{1}{2}$, using the identity $1 - \cos h = 2\sin^2\frac{h}{2}$ and the limit of $\frac{\sin h}{h}$. Then use the result to estimate $\cos(0.1)$ without a calculator.

Show solutionHide solution

For $h \neq 0$,

$$ \frac{1 - \cos h}{h^2} = \frac{2\sin^2\frac{h}{2}}{h^2} = \frac{1}{2}\left(\frac{\sin\frac{h}{2}}{\frac{h}{2}}\right)^2. $$

As $h \to 0$, $\frac{h}{2} \to 0$ as well and is not zero, so the quotient in brackets has limit 1, and by the limit law for products the whole expression has limit $\frac{1}{2} \cdot 1^2 = \frac{1}{2}$. This says $1 - \cos h \approx \frac{h^2}{2}$ for small $h$, so $\cos(0.1) \approx 1 - 0.005 = 0.995$. The true value is $0.995004$.

Problem 7

A point moves around the unit circle so that its angle at time $t$ is $\theta = \omega t$, where $\omega$ is a constant. Its position is $(x, y) = (\cos\omega t, \sin\omega t)$. (a) Find the velocity $(x'(t), y'(t))$. (b) Show that the speed, $\sqrt{x'^2 + y'^2}$, equals $|\omega|$. (c) Show that the velocity is perpendicular to the position by checking that $x\,x' + y\,y' = 0$. How do (b) and (c) relate to the picture of the nudged point?

Show solutionHide solution

(a) By the chain rule with inner function $\omega t$, $x'(t) = -\omega\sin\omega t$ and $y'(t) = \omega\cos\omega t$. (b) $x'^2 + y'^2 = \omega^2\sin^2\omega t + \omega^2\cos^2\omega t = \omega^2$, so the speed is $|\omega|$. (c) $x\,x' + y\,y' = \cos\omega t \cdot (-\omega\sin\omega t) + \sin\omega t \cdot \omega\cos\omega t = 0$. Two vectors whose products of matching coordinates sum to zero are perpendicular. With $\omega = 1$ these are the two facts the picture started from: the point moves one unit of arc per unit of angle, and it moves at right angles to its radius. In the lesson those facts were read off the circle and used to find the derivatives. Here the derivatives, once proved, give the facts back.

Shared definitions used by this lesson's figures
# house kit: prepended to every essay figure after the std imports

# palette. AZURE and EMBER are the two actors, LEAF marks an answer, ROSE a problem
let PAPER = [1, 1, 1, 1]
let INK = [0.08, 0.09, 0.11, 1]
let SLATE = [0.40, 0.44, 0.50, 1]
let MIST = [0.85, 0.86, 0.88, 1]
let AZURE = [0.13, 0.42, 0.68, 1]
let EMBER = [0.89, 0.42, 0.12, 1]
let LEAF = [0.13, 0.55, 0.36, 1]
let ROSE = [0.78, 0.22, 0.24, 1]
let PLUM = [0.47, 0.30, 0.66, 1]
let GOLD = [0.85, 0.62, 0.08, 1]

background = PAPER

# an opaque pastel of col; use for fills so overlaps do not darken
let tint = |col, amount = 0.18| [
    1 - (1 - col[0]) * amount,
    1 - (1 - col[1]) * amount,
    1 - (1 - col[2]) * amount,
    1
]

# text: Cap for labels, Note for quiet labels, Math for typeset maths
let Cap = |txt, size = 0.75, col = INK| color{col} Text(txt, size, "Charter")
let Note = |txt, size = 0.65| color{SLATE} Text(txt, size, "Charter")
let Math = |tex, size = 0.9, col = INK| color{col} Tex(tex, size)

# a paper rectangle to sit behind text that crosses lines
let Plate = |pos, size| center{pos} fill{PAPER} stroke{alpha{0} PAPER, 0} Rect(size)

# shapes with fill and stroke both set, so no stray black appears
let Pt = |pos, col = INK, r = 0.075| center{pos} fill{col} stroke{col, 1} Circle(r, 48)
let Ring = |pos, col = INK, r = 0.1, w = 3| center{pos} fill{PAPER} stroke{col, w} Circle(r, 48)
let Seg = |a, b, col = INK, w = 3| stroke{col, w} Line(a, b)
let Path = |pts, col = INK, w = 3| stroke{col, w} Polyline(pts)
let Region = |pts, col| fill{col} stroke{alpha{0} col, 0} Polygon(pts)
let Outline = |pts, col = INK, w = 3| fill{alpha{0} PAPER} stroke{col, w} Polygon(pts)
let Shape = |pts, col, amount = 0.18, w = 3| fill{tint(col, amount)} stroke{col, w} Polygon(pts)
let Disc = |pos, r, col, amount = 0.18, w = 3| center{pos} fill{tint(col, amount)} stroke{col, w} Circle(r, 96)
let Box = |pos, size, col, amount = 0.18, w = 3| center{pos} fill{tint(col, amount)} stroke{col, w} Rect(size)
# a line from a to b ending in a small solid arrowhead
let Tip = |a, b, col = INK, w = 3, head = 0.17| {
    let d = normalize([b[0] - a[0], b[1] - a[1], 0])
    let n = [-d[1], d[0], 0]
    let base = [b[0] - d[0] * head, b[1] - d[1] * head, 0]
    return [
        stroke{col, w} Line(a, base),
        fill{col} stroke{col, 1} Polygon([
            b,
            [base[0] + n[0] * head * 0.42, base[1] + n[1] * head * 0.42, 0],
            [base[0] - n[0] * head * 0.42, base[1] - n[1] * head * 0.42, 0]
        ])
    ]
}

# plots. a frame is [x0, x1, y0, y1, centre, width, height]: a data window and the scene box it fills
let Frame = |x0, x1, y0, y1, c = [0, 0, 0], w = 6.4, h = 3.6| [x0, x1, y0, y1, c, w, h]
let fx = |fr, x| fr[4][0] + (x - (fr[0] + fr[1]) / 2) * fr[5] / (fr[1] - fr[0])
let fy = |fr, y| fr[4][1] + (y - (fr[2] + fr[3]) / 2) * fr[6] / (fr[3] - fr[2])
let at = |fr, x, y| [fx(fr, x), fy(fr, y), 0]

# axes through the data origin (or the nearest edge of the window), with optional names
let Axes = |fr, x_name = "", y_name = "", col = SLATE| {
    let ox = clamp(fr[0], 0, fr[1])
    let oy = clamp(fr[2], 0, fr[3])
    var parts = [
        Tip(at(fr, fr[0], oy), [fx(fr, fr[1]) + 0.25, fy(fr, oy), 0], col, 2.5, 0.15),
        Tip(at(fr, ox, fr[2]), [fx(fr, ox), fy(fr, fr[3]) + 0.25, 0], col, 2.5, 0.15)
    ]
    if (x_name != "") {
        parts .= center{[fx(fr, fr[1]) + 0.5, fy(fr, oy), 0]} Math(x_name, 0.8, col)
    }
    if (y_name != "") {
        parts .= center{[fx(fr, ox), fy(fr, fr[3]) + 0.5, 0]} Math(y_name, 0.8, col)
    }
    return parts
}

# tick marks with numbers at the listed data values
let XTicks = |fr, xs, col = SLATE, places = 0| block {
    let oy = fy(fr, clamp(fr[2], 0, fr[3]))
    for (x in xs) {
        . Seg([fx(fr, x), oy - 0.07, 0], [fx(fr, x), oy + 0.07, 0], col, 2)
        . center{[fx(fr, x), oy - 0.33, 0]} Math(to_string(x, places), 0.72, col)
    }
}
let YTicks = |fr, ys, col = SLATE, places = 0| block {
    let ox = fx(fr, clamp(fr[0], 0, fr[1]))
    for (y in ys) {
        . Seg([ox - 0.07, fy(fr, y), 0], [ox + 0.07, fy(fr, y), 0], col, 2)
        . center{[ox - 0.36, fy(fr, y), 0]} Math(to_string(y, places), 0.72, col)
    }
}

# faint grid lines at the listed data values
let GridLines = |fr, xs, ys, col = MIST| block {
    for (x in xs) {
        . Seg(at(fr, x, fr[2]), at(fr, x, fr[3]), col, 1.5)
    }
    for (y in ys) {
        . Seg(at(fr, fr[0], y), at(fr, fr[1], y), col, 1.5)
    }
}

# the graph of f over [a, b], drawn in the frame. values are clamped to the window
let Graph = |fr, f, a, b, col = AZURE, w = 4, n = 160|
    stroke{col, w} Polyline(map(sample(a, b, n), |x| at(fr, x, clamp(fr[2], f(x), fr[3]))))

# the region between the graph of f and the x axis over [a, b]
let AreaUnder = |fr, f, a, b, col = AZURE, amount = 0.2, n = 80| {
    var pts = [at(fr, a, 0)]
    for (x in sample(a, b, n)) {
        pts .= at(fr, x, clamp(fr[2], f(x), fr[3]))
    }
    pts .= at(fr, b, 0)
    return fill{tint(col, amount)} stroke{alpha{0} col, 0} Polygon(pts)
}

let pol = |o, r, t| [o[0] + r * cos(t), o[1] + r * sin(t), 0]
let mix = |a, b, u| [a[0] + (b[0] - a[0]) * u, a[1] + (b[1] - a[1]) * u, 0]
# the arc of the circle centre o, radius r, from angle a to angle b
let ArcPath = |o, r, a, b, col, w| {
    let n = to_int(max(1, min(80, ceil(abs(b - a) * r / 0.05))))
    return stroke{col, w} Polyline(map(sample(a, b, n), |t| pol(o, r, t)))
}