tan x is a quotient
, defined wherever , which is every x except for whole numbers n. Both parts have known derivatives, so the quotient rule applies, with x in radians throughout.
The numerator is u = sin x, so u' = cos x. The denominator is v = cos x, so v' = −sin x.
The quotient rule on sin x over cos x
The quotient rule gives .
The second term is sin x times −sin x, subtracted, so the two minus signs make a plus: the numerator is .
The numerator is 1
By Pythagoras, for every x. So the derivative of tan x is , and is sec x, so this is .
Since is at most 1, is at least 1. So tan x rises on every branch of its graph, with gradient never less than 1, and exactly 1 where , at .
Check at three points. At x = 0, . At , , so ; the chord from to has gradient 2.0020. At x = 1, , and a chord with a step of 0.000001 gives 3.4255.
The gold curve y = tan x, for x from −1.5 to 1.5 radians. The dashed line is its tangent at the origin, with gradient . The gold line is its tangent at , with gradient .
sec x
, defined where . The chain rule applies, with inner function cos x and outer function . The outer derivative is , and the inner derivative is −sin x.
So the derivative is . Split it as , and that is sec x tan x.
Check at , where sec x = 2 and : the derivative is , and a chord with a step of 0.000001 gives 3.4641. At x = 0.5 the derivative is 0.6225, and the chord gives 0.6225.
cosec x and cot x
, defined where . The same chain-rule move gives , which splits as −cosec x cot x. At , cosec x = 2 and , so the derivative is . At x = 1 it is −0.7631. Chords give the same two values.
, so the quotient rule applies, with u' = −sin x and v' = cos x. The numerator is , so the derivative is . At that is −2, and at x = 1 it is −1.4123. Chords give the same two values.
cot x is also . The chain rule on gives , and since , that is again.
The four results together
tan x differentiates to , and sec x to sec x tan x. The co-functions follow the same pattern with cot and cosec in place of tan and sec, and a minus sign: cot x differentiates to , and cosec x to −cosec x cot x.
The minus signs match the graphs. On , cot x and cosec x are both falling, while tan x and sec x are both rising.
A coefficient on the angle
The chain rule brings out the inner derivative, as before. For y = tan 3x, the inner function is 3x and the outer function is tan, so , which is 3 at x = 0. For y = sec 2x, , which is 1.6578 at x = 0.3.
The usual mistakes
Giving sec x tan x as the derivative of tan x. That is the derivative of sec x; tan x gives .
Differentiating sin x / cos x term by term, to get . The quotient rule is needed, and it gives .
Dropping the minus from cot or cosec. Both functions fall on , so both derivatives are negative there.
Adding a minus to sec x. The −1 from the power and the minus in −sin x multiply to +1, so sec x differentiates to plus sec x tan x.
A lighthouse beam
In the application below, a lit spot is meters along a wall. Its derivative, , is in meters per radian, and the chain rule turns it into meters per second.
Worked example: A Lighthouse Beam Sweeping Along a Sea Wall: the Speed of the Lit Spot Far from the Perpendicular
Question A lighthouse stands 300 m from a long straight sea wall, and its lamp turns at a steady 0.2 radians per second. The beam lights a point on the wall y meters from the foot of the perpendicular from the lighthouse, where y = 300tanθ and θ is the angle between the beam and that perpendicular. (a) Find dydθ when θ = π4. (b) How fast is the lit spot moving along the wall at that moment?
1.Let θ be the angle between the beam and the perpendicular to the wall. The lit spot is y = 300tanθ meters from the foot of that perpendicular.
The lit spot is y = 300tanθ meters from the foot of the perpendicular, where θ is the beam's angle. 2.Differentiate: ddθ(tanθ) = sec2θ, so dydθ = 300sec2θ meters per radian.
The derivative of tanθ is sec2θ, so dydθ = 300sec2θ. 3.(a) At θ = π4, cosπ4 = 1√2, so sec2π4 = 2 and dydθ = 300 × 2 = 600 meters per radian.
(a) At θ = π4, sec2θ = 2, so dydθ = 600 meters per radian: a rise of 120 m for 0.2 of a radian. 4.Let x be the number of seconds. The lamp turns at dθdx = 0.2 radians per second, and the chain rule gives dydx = dydθ × dθdx.
The lamp turns at dθdx = 0.2 radians per second, and the chain rule multiplies the two rates. 5.(b) dydx = 600 × 0.2 = 120 meters per second. Check: a hundredth of a radian past π4 the spot has moved about 6 m, and the lamp takes 0.05 seconds to turn that far.
(b) dydx = 600 × 0.2 = 120 meters per second.
Answer: (a) 600 meters per radian; (b) the lit spot is moving at 120 meters per second
Common mistakes
- Differentiating tanθ as sinθcosθ term by term, giving cosθ−sinθ. The quotient rule gives cos2θ + sin2θcos2θ = sec2θ instead.
- Reading the 0.2 as a speed in meters per second. It is the turning rate of the lamp, in radians per second, and it becomes a speed along the wall only after it is multiplied by dydθ.
More rules of differentiation problems, worked step by step →