< Trig Derivatives — sin, cos, tan and All Six | MathsTricks

Differentiation, Chapter 06

Derivatives of Trig Functions

This page starts where the chain rule left off. You already know how to differentiate a composite function: now we derive exactly what goes in the outer slot for sin, cos, tan, sec, cosec and cot.

✦ Builds on Chain Rule ✦ All Six Proofs ✦ Complete Reference Table ✦ 12 Worked Exercises ✦ Grouped by Function ✦ 10-Question Quiz
Share this page

§ 01Where We Start From

This page assumes you are comfortable with the chain rule. If you are not, read the Chain Rule page first, it takes about 20 minutes and will make everything here much easier.

The chain rule says: for a composite function y = f(g(x)), the derivative is f′(g(x)) · g′(x). For trig functions, f is one of the six trig functions, and g(x) is whatever sits inside the argument. Once you know f′ for each trig function, the chain rule does the rest automatically.

So this page has one job: tell you what f′ is for each of the six trig functions, and prove it so you can trust it rather than just memorise it. The derivations of d/dx[sin x] and d/dx[cos x] from first principles were already shown on the First Principles page, we build on those results here without repeating them.

What you need from the First Principles page Two limit results are used throughout this page. They are proved on the First Principles page: lim[h→0] sin(h)/h = 1, and lim[h→0] (cos(h)−1)/h = 0. These give d/dx[sin x] = cos x and d/dx[cos x] = −sin x, which are the starting points for everything else here.

§ 02d/dx[sin x] = cos x   and   d/dx[cos x] = −sin x

These two are the foundation. Every other trig derivative follows from them using the quotient rule or the chain rule.

From first principles (derived in full on the First Principles page):

The Two Foundation Results
d/dx [sin x] = cos x
d/dx [cos x] = −sin x

The minus sign on the cosine derivative is not arbitrary, it comes directly from the minus sign in the compound angle formula for cos(x + h). If you find yourself forgetting which one is negative, remember: the derivative of sin is "moving towards cos", and then cos has a minus sign because the cosine graph is heading downward at x = 0 while the sine graph is heading upward.

An important sign pattern

Differentiating sin four times cycles back to sin:

The four-step sin/cos cycle
sin x  →  cos x  →  −sin x  →  −cos x  →  sin x

This cycle is worth memorising. It means d⁴/dx⁴[sin x] = sin x: differentiating four times returns to the original function. You will encounter this in differential equations.

§ 03d/dx[tan x] = sec²x — Derived from sin and cos

We do not need to go back to first principles for tan x. We write tan x = sin x / cos x and apply the quotient rule: using only the two results we already have.

Proof — d/dx [tan x] = sec²x

Write tan x as a quotient:

tan x = sin x / cos x

Apply the quotient rule. Let u = sin x (top) and v = cos x (bottom). Then u′ = cos x and v′ = −sin x:

d/dx[tan x] = (u′v − uv′) / v² = (cos x · cos x − sin x · (−sin x)) / cos²x

Expand and simplify the numerator:

= (cos²x + sin²x) / cos²x

Use the Pythagorean identity sin²x + cos²x = 1:

= 1 / cos²x = sec²x sec x is defined as 1/cos x, so 1/cos²x = sec²x by definition.
Tan Derivative
d/dx [tan x] = sec²x

§ 04The Other Three — sec x, cosec x, cot x

The remaining three functions are all defined as reciprocals of sin, cos, or tan. Write them that way and the quotient rule or chain rule gives their derivatives cleanly.

d/dx[sec x] = sec x tan x

Proof — d/dx [sec x] = sec x tan x

Write sec x = 1 / cos x = (cos x)^(−1). Apply the chain rule:

d/dx[(cos x)^(−1)] = (−1)(cos x)^(−2) · (−sin x)

The two minus signs cancel. Simplify:

= sin x / cos²x = (1/cos x) · (sin x / cos x) = sec x · tan x

d/dx[cosec x] = −cosec x cot x

Proof — d/dx [cosec x] = −cosec x cot x

Write cosec x = (sin x)^(−1). Chain rule:

d/dx[(sin x)^(−1)] = (−1)(sin x)^(−2) · cos x

Simplify:

= −cos x / sin²x = −(1/sin x) · (cos x/sin x) = −cosec x · cot x

d/dx[cot x] = −cosec²x

Proof — d/dx [cot x] = −cosec²x

Write cot x = cos x / sin x. Quotient rule with u = cos x, v = sin x:

= (−sin x · sin x − cos x · cos x) / sin²x = −(sin²x + cos²x) / sin²x = −1/sin²x = −cosec²x

§ 05Complete Reference Table — with Chain Rule Forms

This is your one-stop reference. The chain rule column is the form you will use in 90% of problems: it shows what happens when anything other than a bare x sits inside the trig function.

f(x) f′(x) Chain rule: d/dx [f(g(x))] Note
sin x cos x g′(x) · cos(g(x)) Positive
cos x −sin x −g′(x) · sin(g(x)) Negative
tan x sec²x g′(x) · sec²(g(x)) From quotient rule on sin/cos
sec x sec x tan x g′(x) · sec(g(x)) · tan(g(x)) Both factors keep same argument
cosec x −cosec x cot x −g′(x) · cosec(g(x)) · cot(g(x)) Negative; the cosec of sec
cot x −cosec²x −g′(x) · cosec²(g(x)) Mirrors tan → sec²; cot → −cosec²
The sign pattern — which ones are negative? The three functions that start with "co" (cosine, cosecant, cotangent) all have a negative sign in their derivatives. The three without "co" (sine, secant, tangent) are positive. This is not a coincidence — it reflects a geometric symmetry. Learning the pattern is faster than memorising six separate signs.

§ 06Twelve Worked Exercises

Exercises are grouped by function type so you build fluency with each derivative before combining them. Work each problem before revealing the solution.

Exercises opened: 0 / 12

Group A — sin and cos with the Chain Rule (Exercises 1–4)

Exercise 01 Basic
Differentiate   y = sin(5x)
  1. Outer: sin(□) → derivative cos(□). Inner: 5x → derivative 5.
  2. Chain rule: outer derivative (inner untouched) × inner derivative: dy/dx = cos(5x) · 5 = 5 cos(5x)
Exercise 02 Basic
Differentiate   y = cos(x² + 1)
  1. Outer: cos(□) → derivative −sin(□). Inner: x²+1 → derivative 2x.
  2. Chain rule: dy/dx = −sin(x²+1) · 2x = −2x sin(x²+1)
Exercise 03 Basic
Differentiate   y = 3 sin²(x)   [i.e. 3(sin x)²]
Two layers: outer (□)², inner sin x. The constant 3 stays out front throughout. After applying the chain rule, use the double-angle identity 2 sin x cos x = sin(2x).
  1. Write y = 3(sin x)². Outer: (□)² → 2(□). Inner: sin x → cos x.
  2. Chain rule (constant 3 stays): dy/dx = 3 · 2 sin x · cos x = 6 sin x cos x
  3. Apply double angle identity 2 sin x cos x = sin(2x): dy/dx = 3 sin(2x)
Exercise 04 Basic
Differentiate   y = sin(3x) · cos(3x)
You can use the product rule with u = sin(3x) and v = cos(3x), applying the chain rule to find u′ and v′. Alternatively, use the double-angle identity sin(3x)cos(3x) = (1/2)sin(6x) first and differentiate that instead — much quicker.
  1. Method 1, Double angle first: sin(3x)cos(3x) = (1/2)sin(6x). dy/dx = (1/2) · cos(6x) · 6 = 3 cos(6x)
  2. Method 2, Product rule (to verify): u = sin(3x), u′ = 3cos(3x); v = cos(3x), v′ = −3sin(3x): dy/dx = 3cos(3x)·cos(3x) + sin(3x)·(−3sin(3x)) = 3cos²(3x) − 3sin²(3x) = 3(cos²(3x)−sin²(3x)) = 3cos(6x)
  3. Both methods agree: dy/dx = 3 cos(6x)

Group B — tan, sec, cosec and cot (Exercises 5–8)

Exercise 05 Medium
Differentiate   y = tan(2x)
  1. Outer: tan(□) → sec²(□). Inner: 2x → 2.
  2. Chain rule: dy/dx = sec²(2x) · 2 = 2 sec²(2x)
Exercise 06 Medium
Differentiate   y = sec(x²)
  1. Outer: sec(□) → sec(□)tan(□). Both the sec and the tan keep the same inner argument untouched. Inner: x² → 2x.
  2. Chain rule: dy/dx = sec(x²) tan(x²) · 2x = 2x sec(x²) tan(x²)
Exercise 07 Medium
Differentiate   y = cot(3x + 1)
  1. Outer: cot(□) → −cosec²(□). Inner: 3x+1 → 3.
  2. Chain rule: dy/dx = −cosec²(3x+1) · 3 = −3 cosec²(3x+1)
Exercise 08 Medium
Differentiate   y = cosec(eˣ)
Outer: cosec(□) → −cosec(□)cot(□). Inner: eˣ → eˣ. Both the cosec and the cot in the outer derivative keep the inner argument eˣ untouched.
  1. Outer: cosec(□) → −cosec(□)cot(□). Inner: eˣ → eˣ.
  2. Chain rule: dy/dx = −cosec(eˣ) cot(eˣ) · eˣ = −eˣ cosec(eˣ) cot(eˣ)

Group C — Combined Rules (Exercises 9–12)

Exercise 09 Hard
Differentiate   y = x · tan(x)   (product rule + trig)
  1. Product rule: u = x (u′ = 1), v = tan x (v′ = sec²x).
  2. dy/dx = u′v + uv′: = 1 · tan x + x · sec²x dy/dx = tan x + x sec²x
Exercise 10 Hard
Differentiate   y = sin(x) / (1 + cos x)   (quotient rule)
Quotient rule: u = sin x (top), v = 1 + cos x (bottom). u′ = cos x, v′ = −sin x. After substituting, use the identity sin²x + cos²x = 1 to simplify the numerator.
  1. Quotient rule: u = sin x, v = 1+cos x, u′ = cos x, v′ = −sin x.
  2. dy/dx = (u′v − uv′) / v²: = [cos x(1+cos x) − sin x(−sin x)] / (1+cos x)² = [cos x + cos²x + sin²x] / (1+cos x)²
  3. Use sin²x + cos²x = 1 in the numerator: = [cos x + 1] / (1+cos x)² = (1+cos x) / (1+cos x)²
  4. Cancel (1+cos x): dy/dx = 1 / (1 + cos x)
Exercise 11 Hard
Differentiate   y = e^x · sin²(x)
  1. Product rule: u = eˣ (u′ = eˣ), v = sin²x.
  2. Find v′ using chain rule on sin²x = (sin x)²: v′ = 2 sin x · cos x = sin(2x)
  3. Apply product rule: dy/dx = eˣ · sin²x + eˣ · sin(2x)
  4. Factorise eˣ: dy/dx = eˣ [sin²x + sin(2x)]
Exercise 12 Hard
Differentiate   y = tan²(3x)   (double chain)
Three layers: outer (□)², middle tan(□), inner 3x. Apply chain rule twice working outward-to-inward: outer derivative is 2·tan(3x), then multiply by the derivative of tan(3x) which itself uses the chain rule.
  1. Write y = (tan(3x))². Outer: (□)² → 2(□). Leave tan(3x) untouched: 2 tan(3x).
  2. Now differentiate tan(3x) via chain rule. Outer tan(□) → sec²(□). Inner 3x → 3: d/dx [tan(3x)] = sec²(3x) · 3 = 3 sec²(3x)
  3. Multiply everything together: dy/dx = 2 tan(3x) · 3 sec²(3x) dy/dx = 6 tan(3x) sec²(3x)

§ 07Common Mistakes

These errors appear most frequently when trig derivatives are examined. They are all easy to avoid once you know what to watch for.

✗ Forgetting the minus sign on cos, cosec, and cot

Wrong: d/dx[cos x] = sin x

Correct: d/dx[cos x] = −sin x. The three "co-" functions (cosine, cosecant, cotangent) all have a minus sign. Sine, tangent, and secant do not.

✗ Forgetting to apply the chain rule to the argument

Wrong: d/dx[sin(3x)] = cos(3x)

Correct: d/dx[sin(3x)] = 3 cos(3x). Whenever the argument is anything other than a bare x, multiply by the inner derivative. Missing this factor is the single most common trig differentiation error.

✗ Writing sec²(x) as the derivative of sin x or cos x

sec²x is the derivative of tan x only. The derivatives of sin x and cos x stay in the sin/cos family, cos x and −sin x respectively. sec² has nothing to do with sin or cos directly.

✗ Confusing sec x tan x (derivative of sec) with sec²x (derivative of tan)

Both appear frequently and look similar. The memory trick: tan comes before sec in the alphabet, and tan → sec². sec comes after, and sec → sec·tan (it needs its neighbour).

✗ Not spotting that a double-angle simplification is possible first

For expressions like sin x cos x or sin²x, it is almost always faster to simplify using the double-angle identities before differentiating, rather than applying the product rule or chain rule to the unmodified expression.

sin x cos x = (1/2) sin(2x)  →  differentiates immediately to cos(2x).
sin²x = (1/2)(1 − cos(2x))  →  differentiates to sin(2x).

§ 0810-Question Quiz

Select one answer per question then press Submit.

Trig Derivatives — Quiz

Question 01 of 10
What is d/dx [cos x]?
  • sin x
  • −sin x
  • sec²x
  • −cos x
Question 02 of 10
What is d/dx [tan x]?
  • sin x / cos x
  • sec x tan x
  • sec²x
  • cosec²x
Question 03 of 10
Differentiate y = sin(7x)
  • cos(7x)
  • 7 sin(7x)
  • 7 cos(7x)
  • −7 cos(7x)
Question 04 of 10
What is d/dx [sec x]?
  • sec²x
  • tan²x
  • sec x tan x
  • −sec x tan x
Question 05 of 10
Differentiate y = cos(x³)
  • −sin(x³)
  • 3x² sin(x³)
  • −3x² sin(x³)
  • 3x² cos(x³)
Question 06 of 10
Which three trig derivatives have a negative sign?
  • sin, tan, sec
  • cos, cosec, cot
  • cos, tan, cot
  • sin, cos, cosec
Question 07 of 10
Differentiate y = tan(x²)
  • sec²(x²)
  • 2x sec²(x²)
  • 2 sec²(x²)
  • 2x sec(x²)tan(x²)
Question 08 of 10
What is d/dx [cot x]?
  • sec²x
  • −sec²x
  • cosec²x
  • −cosec²x
Question 09 of 10
Differentiate y = sin²(x) using the chain rule
  • 2 sin x
  • 2 cos x
  • sin(2x)
  • cos(2x)
Question 10 of 10
The derivative of sec x is derived by writing sec x as:
  • sin x / cos x and applying the quotient rule
  • (cos x)^(−1) and applying the chain rule
  • 1 / sin x and applying the quotient rule
  • cos(−x) and differentiating directly
❧     ❧     ❧

Cookie Settings