Derivatives of Trigonometric Functions

Updated 15 min read Intermediate Baca dalam Bahasa Indonesia

Calculus Proof Computing

Quick answer

The derivative of sine is cosine and the derivative of cosine is minus sine, for angles in radians: (d)/(dx)\sin x=\cos x and (d)/(dx)\cos x=-\sin x. The other four follow from the quotient rule: \tan'x=\sec^2x, \cot'x=-\csc^2x, \sec'x=\sec x\tan x and \csc'x=-\csc x\cot x. Everything rests on two limits, (\sin h)/(h)→1 and (\cos h-1)/(h)→0, which are true only when h is measured in radians.

Key takeaways

  • The two limits \lim_h→0(\sin h)/(h)=1 and \lim_h→0(\cos h-1)/(h)=0 follow from the squeeze \sin h<h<\tan h; with h in degrees the first becomes (π)/(180)≈0.01745.
  • With the angle-sum formulas the difference quotient of sine splits into \sin x·(\cos h-1)/(h)+\cos x·(\sin h)/(h), which tends to \cos x; cosine gives -\sin x in the same way.
  • The quotient rule gives \tan'x=\sec^2x, \cot'x=-\csc^2x, \sec'x=\sec x\tan x and \csc'x=-\csc x\cot x: the three "co" functions get a minus sign.
  • A weight on a spring pulled down 5 units has position s=5\cos t, velocity -5\sin t and acceleration -5\cos t=-s: simple harmonic motion, with the greatest speed at the rest position.
  • The derivatives of sine and cosine repeat every four steps, so (d^999)/(dx^999)\cos x=\sin x: only the remainder of n divided by 4 matters.
  • These formulas are for \sin x and the others with plain x inside; a function such as \sin 2x or \sin^2x needs the chain rule.

Why does the derivative of sine depend on the limit of sin h over h?

Because the difference quotient of \sin x, once the angle-sum formula is used, splits into two pieces, one multiplied by (\cos h-1)/(h) and the other by (\sin h)/(h), so the derivative is known as soon as those two limits are. Both are limits of the form \frac00: the numerator and the denominator tend to zero together, and the answer depends on how fast each does it. The two facts are \lim_h→0(\sin h)/(h)=1 \lim_h→0(\cos h-1)/(h)=0, with h measured in radians.

The squeeze for (\sin h)/(h). Draw a circle of radius 1 and an angle h with 0<h<(π)/(2). It cuts a sector out of the circle, and three areas can be compared, all inside each other:

  • the thin triangle with a vertical side of height \sin h has area \frac12\sin h;
  • the sector has area \frac12h, because a sector of angle h radians is the fraction (h)/(2π) of the circle's area π;
  • the larger triangle that touches the circle at the end of the arc has height \tan h and area \frac12\tan h.

The first lies inside the second, which lies inside the third, so \sin h<h<\tan h. Dividing by \sin h, which is positive, gives 1<(h)/(\sin h)<(1)/(\cos h), and taking reciprocals reverses the inequalities: \cos h<(\sin h)/(h)<1. As h→0^+ the cosine tends to 1, so the squeeze theorem forces (\sin h)/(h)→1. The quotient does not change when h becomes -h, because both \sin h and h change sign, so the limit from the left is the same, and the two-sided limit is 1.

Why \cos h→1. From the double-angle formula, 1-\cos h=2\sin^2\frac h2, and \sin\frac h2<\frac h2 from the inequality above, so 0\le1-\cos h<(h^2)/(2), which tends to 0.

The second limit. Multiply the top and the bottom by 1+\cos h: (\cos h-1)/(h)=-((1-\cos h)(1+\cos h))/(h (1+\cos h)) =-(\sin^2h)/(h (1+\cos h)) =-(\sin h)/(h)·(\sin h)/(1+\cos h). The first factor tends to 1 and the second to 0/2=0, so the product tends to 0. The same bound shows it quickly: 0\le(1-\cos h)/(h)<\frac h2.

Three limits that follow.

  • \lim_x→0(\sin 3x)/(x)=3\lim_x→0(\sin3x)/(3x)=3·1=3, because 3x→0 when x→0.
  • \lim_x→0(\tan x)/(x)=\lim_x→0(\sin x)/(x)·(1)/(\cos x)=1·1=1.
  • \lim_x→0(1-\cos x)/(x^2)=\lim_x→0(\sin^2x)/(x^2(1+\cos x))=1·\frac12=\frac12.

Why radians. The area of the sector, \frac12h, is true only for radian measure. If h is in degrees, the angle in radians is (π h)/(180), and the first limit becomes (π)/(180)≈0.01745, not 1. The derivative of sine would then carry that awkward factor every time. Calculus measures angles in radians so that the factor is 1.

Move h toward zero below, in radians and then in degrees, and watch the two quotients.

Interactive: the limit behind sine and cosine

See sin h < h < tan h on a unit circle and the table of sin h / h and (cos h − 1) / h as h shrinks, then switch to degrees to see why calculus insists on radians.

What are the derivatives of sin x and cos x?

The derivative of \sin x is \cos x and the derivative of \cos x is -\sin x, for every real x measured in radians. (d)/(dx)\sin x=\cos x (d)/(dx)\cos x=-\sin x.

Proof for sine. Use the angle-sum formula \sin(x+h)=\sin x\cos h+\cos x\sin h in the difference quotient: (\sin(x+h)-\sin x)/(h) =(\sin x\cos h+\cos x\sin h-\sin x)/(h) =\sin x·(\cos h-1)/(h)+\cos x·(\sin h)/(h). Here x is fixed and h is the one that changes, so \sin x and \cos x are constants as h→0. By the two limits of the previous section the quotient tends to \sin x·0+\cos x·1=\cos x.

Proof for cosine. Use \cos(x+h)=\cos x\cos h-\sin x\sin h: (\cos(x+h)-\cos x)/(h) =(\cos x\cos h-\sin x\sin h-\cos x)/(h) =\cos x·(\cos h-1)/(h)-\sin x·(\sin h)/(h) →\cos x·0-\sin x·1=-\sin x.

What it looks like. The slope of the sine wave is 1 where it crosses the axis going up, 0 at the peaks and valleys and -1 where it crosses going down, so the graph of the slopes is the cosine wave. The cosine starts at its peak with slope 0 and then falls, so its slope is negative just after: minus the sine wave. Differentiating twice flips the sign: (d^2)/(dx^2)\sin x=-\sin x.

Examples. All of these use the rules of differentiation together with the two new formulas.

  • y=x^2-\sin x gives y'=2x-\cos x.
  • y=e^x\sin x gives, by the product rule, y'=e^x\sin x+e^x\cos x=e^x(\sin x+\cos x).
  • y=(\sin x)/(x) gives, by the quotient rule, y'=(x\cos x-\sin x)/(x^2).
  • y=5e^x+\cos x gives y'=5e^x-\sin x.
  • y=\sin x\cos x gives y'=\cos x·\cos x+\sin x·(-\sin x)=\cos^2x-\sin^2x, which is \cos 2x.
  • y=(\cos x)/(1-\sin x) gives y'=((-\sin x)(1-\sin x)-\cos x (-\cos x))/((1-\sin x)^2)=(1-\sin x)/((1-\sin x)^2)=(1)/(1-\sin x), because \sin^2x+\cos^2x=1.

Both functions are differentiable everywhere, so both are continuous everywhere, and the graph of the derivative of a wave is another wave, as in graphing the derivative.

sin x (green) and its derivative cos x (orange), in radians: where the green wave peaks its slope is 0, so the orange wave crosses the axis there.

Slide the point along any of the six graphs below: the tangent line is drawn, and a second graph shows the slope it has there.

Interactive: a trigonometric graph and its slopes

Slide a point along the graph of sin, cos, tan, cot, sec or csc and watch the slope of its tangent trace out the graph of the derivative underneath.

What are the derivatives of tan, cot, sec and csc?

The derivatives of the other four are \tan'x=\sec^2x, \cot'x=-\csc^2x, \sec'x=\sec x\tan x and \csc'x=-\csc x\cot x, and each comes from the quotient rule applied to sine and cosine. They hold at every x where the function is defined: for \tan and \sec that excludes the odd multiples of (π)/(2), and for \cot and \csc the multiples of π.

  • Tangent. \tan x=(\sin x)/(\cos x), so \tan'x=(\cos x·\cos x-\sin x·(-\sin x))/(\cos^2x)=(\cos^2x+\sin^2x)/(\cos^2x)=(1)/(\cos^2x)=\sec^2x.
  • Cotangent. \cot x=(\cos x)/(\sin x), so \cot'x=(-\sin x·\sin x-\cos x·\cos x)/(\sin^2x)=(-1)/(\sin^2x)=-\csc^2x.
  • Secant. \sec x=(1)/(\cos x), so \sec'x=(0·\cos x-1·(-\sin x))/(\cos^2x)=(\sin x)/(\cos^2x)=(1)/(\cos x)·(\sin x)/(\cos x)=\sec x\tan x.
  • Cosecant. \csc x=(1)/(\sin x), so \csc'x=(0·\sin x-1·\cos x)/(\sin^2x)=(-\cos x)/(\sin^2x)=-\csc x\cot x.

One table for all six. The three functions that begin with "co" have a minus sign, as cosine does.

FunctionDerivative
\sin x\cos x
\cos x-\sin x
\tan x\sec^2x
\cot x-\csc^2x
\sec x\sec x\tan x
\csc x-\csc x\cot x

What the slopes say. Since \cos^2x\le1, the slope \sec^2x of the tangent is never below 1: the tangent function always rises, is flattest at the origin, where \sec^2 0=1, and gets steeper without bound near each vertical asymptote. At x=(π)/(4) it is \sec^2(π)/(4)=2, so the tangent line of y=\tan x there passes through \left((π)/(4),1\right) with slope 2. The cotangent is its mirror image, always falling, with slope at most -1. The slope \sec x\tan x of the secant is 0 at the multiples of π, where the secant is ±1.

Horizontal tangents. Where does y=x+2\sin x have a horizontal tangent on 0\le x\le2π? Set y'=1+2\cos x=0, so \cos x=-\frac12, which gives x=(2π)/(3) and x=(4π)/(3). The points are \left((2π)/(3),(2π)/(3)+√3\right) and \left((4π)/(3),(4π)/(3)-√3\right), about (2.09, 3.83) and (4.19, 2.46).

A second derivative. For y=\sec x, y'=\sec x\tan x and the product rule gives y''=\sec x\tan x·\tan x+\sec x·\sec^2x =\sec^3x+\sec x\tan^2x. Because \tan^2x=\sec^2x-1 this is also 2\sec^3x-\sec x.

Type any expression below, with sums, products and quotients of the six functions, powers of x and e^x, and the steps are shown rule by rule, up to the fourth derivative.

Interactive: differentiate with sine, cosine and the rest

Type a function made of sin x, cos x, tan x, cot x, sec x, csc x, powers of x, e^x, sums, products and quotients, and see each rule applied, the derivative and higher derivatives, checked against a difference quotient.

How do sine and cosine describe a weight on a spring?

A weight hanging from a spring, pulled down 5 units and let go at time t=0, moves as s=5\cos t; differentiating gives its velocity v=-5\sin t, its acceleration a=-5\cos t and its jerk j=5\sin t, so the acceleration is always the negative of the position: a=-s. This is simple harmonic motion. Measure s downward from the rest position, in centimeters, and t in seconds. The derivatives are those of motion along a line, with the two new formulas supplying each one.

  • Position. s=5\cos t moves between -5 and 5. The distance 5 from the rest position is the amplitude. The motion repeats after 2π seconds, the period, because cosine does.
  • Velocity. v=(ds)/(dt)=-5\sin t. It is negative just after t=0, so the weight moves upward, and it is 0 at t=0 because the weight is let go from rest.
  • Acceleration. a=(dv)/(dt)=-5\cos t=-s. When the weight is below the rest position (s>0) the acceleration points upward, and when it is above (s<0) it points downward: it always points back to the rest position. A spring pulling with a force proportional to the stretch, F=-ks, gives exactly this, and that is Hooke's law.
  • Jerk. j=(da)/(dt)=5\sin t.

Where is the speed greatest? The speed is |v|=5|\sin t|. It is greatest, 5 cm/s, when \sin t=±1, that is, when \cos t=0, which is when the weight passes the rest position s=0. It is 0 at the ends of the swing, s=±5, where the weight turns around. The acceleration is the opposite way round: it is greatest, in size, at the ends, and 0 at the rest position. The jerk is greatest at the rest position, where the acceleration changes sign fastest.

Energy check. From s=5\cos t and v=-5\sin t, s^2+v^2=25\cos^2t+25\sin^2t =25=A^2, so a point with coordinates (s,v) goes around a circle of radius 5: when the position is large the velocity is small, and the other way round.

Other periods. A stiffer spring or a lighter weight swings faster, with s=A\cos(\omega t) for a constant \omega, and then each derivative picks up a factor \omega. That is the chain rule at work, which this article does not need yet: here \omega=1.

Change the amplitude and the time below and watch the weight, the two graphs and the numbers.

Interactive: a weight on a spring

Pull a weight down A units and let it go: its position A cos t, velocity −A sin t and acceleration −A cos t, with the weight bobbing on its spring and the graphs of position and velocity.

What is the nth derivative of sin x or cos x?

The derivatives of sine and cosine repeat every four steps, so the nth derivative depends only on the remainder of n divided by 4. Starting from sine the derivatives go \sin x, \cos x, -\sin x, -\cos x and then \sin x again; starting from cosine they go \cos x, -\sin x, -\cos x, \sin x and then \cos x again.

n divided by 4 leaves(d^n)/(dx^n)\sin x(d^n)/(dx^n)\cos x
0\sin x\cos x
1\cos x-\sin x
2-\sin x-\cos x
3-\cos x\sin x

The reason is that the derivative of sine is a quarter of a turn ahead of it: four such steps bring the wave back to where it started. Both functions satisfy y''=-y, which is the equation of the spring in the previous section.

Three examples. The ordinary higher-order derivative is n steps of differentiation, so reduce n first.

  • (d^999)/(dx^999)\cos x: 999=4·249+3, remainder 3, so the answer is \sin x.
  • (d^110)/(dx^110)\left(\sin x-3\cos x\right): 110=4·27+2, remainder 2, so each function is replaced by its own negative and the answer is -\sin x+3\cos x.
  • (d^73)/(dx^73)\sin x: 73=4·18+1, remainder 1, so the answer is \cos x.

The other four do not repeat. The derivatives of tangent grow instead: \tan'x=\sec^2x, \tan''x=2\sec^2x\tan x by the product rule, and each next one is longer, since \sec and \tan keep multiplying by one another. Only sine and cosine, being waves that sit in a circle, cycle.

How do you differentiate trigonometric functions in code?

SymPy knows the whole table: sp.diff(sp.sin(x), x) gives cos(x), and sp.diff(f, x, n) takes the nth derivative, even for n=999. SymPy writes \sec^2x as tan(x)**2 + 1, which is the same function by \sec^2x=1+\tan^2x. The second program checks the limits numerically. In radians, sin(h)/h climbs to 1 and (cos(h) - 1)/h shrinks like -\frac h2; in degrees, after converting with h * pi/180, the first quotient settles at (π)/(180)=0.0174533.

Python and SymPy: the whole table, and a high derivative
import sympy as sp

x = sp.symbols('x')
for f in (sp.sin(x), sp.cos(x), sp.tan(x), sp.cot(x), sp.sec(x), sp.csc(x)):
    print(f, '->', sp.diff(f, x))
# sin(x) -> cos(x)
# cos(x) -> -sin(x)
# tan(x) -> tan(x)**2 + 1            (that is sec(x)**2)
# cot(x) -> -cot(x)**2 - 1           (that is -csc(x)**2)
# sec(x) -> tan(x)*sec(x)
# csc(x) -> -cot(x)*csc(x)

print(sp.diff(sp.exp(x) * sp.sin(x), x))              # exp(x)*sin(x) + exp(x)*cos(x)
print(sp.simplify(sp.diff(sp.cos(x) / (1 - sp.sin(x)), x)))   # -1/(sin(x) - 1), which is 1/(1 - sin(x))
print(sp.diff(sp.cos(x), x, 999))                     # sin(x)
print(sp.diff(sp.sin(x) - 3 * sp.cos(x), x, 110))     # -sin(x) + 3*cos(x)
Python: the two limits, and the degrees trap
import math

for h in (0.1, 0.01, 0.001, 0.0001):
    print(h, round(math.sin(h) / h, 8), round((math.cos(h) - 1) / h, 8))
# 0.1    0.99833417 -0.04995835
# 0.01   0.99998333 -0.00499996
# 0.001  0.99999983 -0.0005
# 0.0001 1.0        -5e-05

d = math.pi / 180                                    # one degree, in radians
for h in (1, 0.1, 0.01):
    print(h, round(math.sin(h * d) / h, 8))          # 0.01745241, 0.01745328, 0.01745329
print(round(d, 8))                                   # 0.01745329: the limit is pi/180, not 1

print(math.sin(30), math.sin(math.radians(30)))      # -0.988... and 0.5: sin(30) treats 30 as radians

for h in (0.1, 0.01, 0.001):
    print(h, (math.sin(1 + h) - math.sin(1 - h)) / (2 * h))   # 0.5394, 0.54029, 0.5403022
print(math.cos(1))                                   # 0.5403023: the central difference reaches cos(1)
C++
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

const double PI = acos(-1.0);

int main() {
  double hs[4] = {0.1, 0.01, 0.001, 0.0001};
  for (int i = 0; i < 4; i++) {
    double h = hs[i];
    printf("%.4f  %.8f  %.8f\n", h, sin(h) / h, (cos(h) - 1) / h);    // the two limits: 1 and 0
  }
  double d = PI / 180;                                  // one degree, in radians
  double ds[3] = {1, 0.1, 0.01};
  for (int i = 0; i < 3; i++) printf("%.2f  %.8f\n", ds[i], sin(ds[i] * d) / ds[i]);
  printf("%.8f\n", d);                                  // the limit in degrees is pi/180, not 1

  printf("%.6f %.6f\n", sin(30.0), sin(30 * d));        // sin(30) treats 30 as radians
  for (int i = 0; i < 3; i++) {
    double h = hs[i];
    printf("%.4f  %.7f\n", h, (sin(1 + h) - sin(1 - h)) / (2 * h));  // the central difference of sin at 1
  }
  printf("%.7f\n", cos(1.0));                           // ... reaches cos(1)
  return 0;
}

/* output:
0.1000  0.99833417  -0.04995835
0.0100  0.99998333  -0.00499996
0.0010  0.99999983  -0.00050000
0.0001  1.00000000  -0.00005000
1.00  0.01745241
0.10  0.01745328
0.01  0.01745329
0.01745329
-0.988032 0.500000
0.1000  0.5394023
0.0100  0.5402933
0.0010  0.5403022
0.5403023
*/

The trap in any language is the unit. math.sin, Math.sin and NumPy's np.sin all expect radians, so math.sin(30) is the sine of 30 radians, -0.988, and not 0.5. Convert with math.radians first. The same unit is behind the derivative formulas: the numbers cos(1) and the central difference above agree only because x=1 is a radian measure.

Who first studied sine, and when did it become a function of calculus?

The sine began as a table of lengths in astronomy, and it became a function with a derivative only when radians and infinite series arrived.

  • Chords and the first sine. Greek astronomers such as Hipparchus and, around 150, Ptolemy tabulated the lengths of chords of a circle. Indian astronomers, in the fifth century and after, replaced the chord by half the chord, the jya, which is the sine. The word "sine" comes from it by way of Arabic, translated into the Latin sinus.
  • Series. In the Kerala school in India, Madhava of Sangamagrama and his successors, around the 14th century, found infinite series for sine and cosine, about two centuries before they were found again in Europe. Isaac Newton had them in the 1660s and used them in calculus.
  • Radians. Roger Cotes in 1714 saw that the natural measure of an angle is the length of its arc on a circle of radius 1. The word "radian" itself first appeared in print in 1873.
  • The modern functions. Leonhard Euler, in his Introductio in analysin infinitorum (1748), treated sine and cosine as functions of a number, in radians, with the notation we use today.
  • Hooke's law. Robert Hooke published "as the extension, so the force" in 1678, the spring law behind simple harmonic motion.

What mistakes do people make with trigonometric derivatives?

The most common mistakes with trigonometric derivatives are the nine below, each with the correct statement.

MistakeCorrect
❌ (d)/(dx)\cos x=\sin xThe derivative of cosine has a minus sign: -\sin x. The cosine starts at its peak and falls, so its slope is negative.
❌ (d)/(dx)\sin 2x=\cos 2xThe table is for \sin x with a plain x inside. With 2x inside the wave is twice as steep: the derivative is 2\cos 2x, from the chain rule.
❌ (d)/(dx)\tan x=\sec xThe derivative of tangent is \sec^2x. The expression \sec x\tan x is the derivative of \sec x.
❌ (d)/(dx)\sec x=\sec^2x\sec^2x is the derivative of \tan x. For secant, \sec'x=\sec x\tan x.
❌ (d)/(dx)\sin^2x=\cos^2x\sin^2x=\sin x·\sin x, and the product rule gives \cos x\sin x+\sin x\cos x=2\sin x\cos x.
❌ (d)/(dx)(\sin x\cos x)=\cos x·(-\sin x)The product rule has two terms: \cos x·\cos x+\sin x·(-\sin x)=\cos^2x-\sin^2x.
❌ (d)/(dx)\sec x=(1)/(-\sin x)The derivative of a reciprocal is -(f')/(f^2), not one over the derivative: \left((1)/(\cos x)\right)'=(\sin x)/(\cos^2x)=\sec x\tan x.
❌ \lim_h→0(\sin h)/(h)=0 because \sin 0=0It is a \frac00 form: top and bottom both go to 0, and the squeeze \cos h<(\sin h)/(h)<1 shows the limit is 1.
❌ (d)/(dx)\sin x=\cos x also holds when x is in degreesOnly in radians. In degrees (d)/(dx)\sin x^\circ=(π)/(180)\cos x^\circ.

Practice: test your understanding

These questions mix everything above. A wrong answer costs nothing here: read the hint and try again.

True or false?

Decide whether each statement is True or False.

  • (d)/(dx)\sin x=\cos x when x is in radians.
  • (d)/(dx)\cos x=\sin x.
  • (d)/(dx)\tan x=\sec^2x.
  • (d)/(dx)\csc x=\csc x\cot x.
  • In degrees, (\sin h)/(h) tends to 1 as h→0.
  • The slope of \tan x is never below 1.

Select all that apply

Choose all the correct derivative formulas.

  • (\sin x)'=\cos x
  • (\cos x)'=-\sin x
  • (\cot x)'=-\csc^2x
  • (\sec x)'=\sec x\tan x
  • (\tan x)'=-\sec^2x

A product

For y=x\sin x find y'\left((π)/(2)\right).

The slope of the tangent

Find the slope of y=\tan x at x=(π)/(4).

The slope of the cotangent

Find the slope of y=\cot x at x=(π)/(4).

A quotient

What is the derivative of (\cos x)/(1-\sin x)?

  • (1)/(1-\sin x)
  • -(1)/(1-\sin x)
  • (1)/(1+\sin x)
  • (-\sin x)/(-\cos x)

A high derivative

Find the value at x=0 of the 101st derivative of \sin x.

The 110th derivative

What is (d^110)/(dx^110)\cos x?

  • \cos x
  • -\cos x
  • \sin x
  • -\sin x

The fastest point of the spring

A weight moves as s=5\cos t. Where is its speed the greatest?

  • at the rest position, s=0
  • at the top of the swing, s=-5
  • at the bottom of the swing, s=5
  • the speed is constant

A velocity

A weight has position s=5\cos t cm. Find its velocity at t=(π)/(2), in cm/s.

A limit

Find \lim_x→0(\sin3x)/(x).

Degrees

What is (d)/(dx)\sin x^\circ, where x is measured in degrees?

  • \cos x^\circ
  • (π)/(180)\cos x^\circ
  • (180)/(π)\cos x^\circ
  • -(π)/(180)\cos x^\circ

Summary: derivatives of trigonometric functions at a glance

  • Two limits: (\sin h)/(h)→1 and (\cos h-1)/(h)→0, from the squeeze \cos h<(\sin h)/(h)<1; in radians only (in degrees the first is (π)/(180)).
  • Sine and cosine: (\sin x)'=\cos x and (\cos x)'=-\sin x, by the angle-sum formulas.
  • The other four: (\tan x)'=\sec^2x, (\cot x)'=-\csc^2x, (\sec x)'=\sec x\tan x, (\csc x)'=-\csc x\cot x, by the quotient rule; the "co" functions are negative.
  • Slopes: the slope of \tan x is at least 1; y=x+2\sin x has horizontal tangents at (2π)/(3) and (4π)/(3) on [0,2π].
  • Spring: s=5\cos t, v=-5\sin t, a=-s; the speed is greatest at the rest position and zero at the ends.
  • Higher derivatives: sine and cosine repeat every four steps; reduce n modulo 4.
  • Not yet: \sin 2x and \sin^2x need the chain rule.
  • Code: sp.diff(f, x, n); angles in math.sin are in radians.

Glossary: key terms

Radian
The angle at the center of a circle that cuts off an arc as long as the radius; the unit in which the derivatives of sine and cosine take their simple form.
Squeeze theorem
If a quantity lies between two others that tend to the same limit, it tends to that limit too; it gives the limit of sin h over h as 1.
Cofunction
One of the functions cosine, cotangent and cosecant, whose derivative carries a minus sign, as in the derivative of cosine being minus sine.
Secant function
The reciprocal of the cosine, one over cos x; its derivative is sec x times tan x.
Simple harmonic motion
Motion in which the acceleration is always proportional to the displacement and points back to the rest position, so the position is a sine or cosine of time.
Amplitude
The greatest distance of an oscillating quantity from its rest position, such as the 5 in the motion s equals 5 cos t.
Period
The time after which an oscillation repeats itself; for sine and cosine of t it is 2π.
Hooke's law
The law that the force of a spring is proportional to its stretch and points back toward the rest position, which leads to simple harmonic motion.

Frequently asked questions

What is the derivative of sin x?

The derivative of sine of x is cosine of x, when x is measured in radians. It follows from the angle-sum formula and the limits of sine h over h, which is 1, and cosine h minus 1 over h, which is 0, as h tends to zero.

What is the derivative of cos x?

The derivative of cosine of x is minus sine of x. The minus sign is there because the cosine starts at its peak and falls, so just after zero its slope is negative, and the slope curve is the sine curve turned upside down.

What are the derivatives of tan, cot, sec and csc?

Tangent has derivative secant squared, cotangent has minus cosecant squared, secant has secant times tangent, and cosecant has minus cosecant times cotangent. All four come from the quotient rule applied to sine and cosine.

Why does calculus use radians for trigonometric derivatives?

Only in radians does sine h over h tend to 1. In degrees the limit is pi over 180, about 0.01745, and every derivative of sine and cosine would carry that factor. Radians remove it, so the derivative of sine is exactly cosine.

What is the limit of sin x over x as x approaches zero?

It is 1, when x is in radians. The proof squeezes the quotient between cosine x and 1, using the areas of a triangle, a circular sector and a larger triangle, which give the inequality sine x is less than x, which is less than tangent x.

What is the nth derivative of sin x?

The derivatives of sine repeat every four steps: cosine, minus sine, minus cosine, then sine again. So divide n by 4 and look at the remainder: 1 gives cosine, 2 gives minus sine, 3 gives minus cosine, and 0 gives sine itself.

What is simple harmonic motion?

It is motion in which the acceleration is proportional to the displacement and points back to the rest position, like a weight on a spring. Its position is a sine or cosine of time, and its speed is greatest as it passes the rest position.

How do you differentiate sin x times cos x?

Use the product rule: the derivative of sine times cosine, plus sine times the derivative of cosine. That gives cosine squared minus sine squared, which is also the cosine of two x.

References

  1. Joel Hass, Christopher Heil, Maurice D. Weir et al. (2023). Thomas' Calculus: Early Transcendentals in SI Units (15th ed.), Section 3.5: Derivatives of Trigonometric Functions. Pearson.
  2. James Stewart (2015). Calculus (8th ed.), section 3.3: Derivatives of Trigonometric Functions. Cengage Learning.
  3. Leonhard Euler (1748). Introductio in analysin infinitorum. Lausanne.
  4. Robert Hooke (1678). De Potentia Restitutiva, or of Spring. John Martyn, London.
  5. SymPy Development Team. SymPy tutorial: Calculus. docs.sympy.org. https://docs.sympy.org/latest/tutorials/intro-tutorial/calculus.html.
  • The Derivative as a Rate of Change: The derivative as a rate of change: velocity, speed, acceleration and jerk, free fall, marginal cost and revenue, sensitivity to change, and rates from data in code.
  • Differentiation Rules: Differentiation rules with proofs and examples: constant, power, multiple, sum, product and quotient rules, the derivative of e^x, and higher-order derivatives.
  • The Chain Rule: The chain rule explained: how to find the inside and outside of a composite function, the power chain rule, nested functions, second derivatives, and code.
  • Circles: Circumference, Area, Angles and Equations: Circles explained: pi, circumference and area, arcs and sectors, angle theorems, chords and tangents, the equation of a circle, and how lines and circles meet.