Derivatives of the Six Trig Functions
You know how to differentiate polynomials using the power rule. But what happens when your function involves sine, cosine, or tangent? Trig functions require their own derivative rules — and knowing them cold is essential for any calculus course.
The good news: the derivatives of trig functions follow patterns that are genuinely elegant once you see them. They don't require memorizing random formulas; they flow from just two starting facts.
The Two Fundamentals
Everything in this lesson flows from two facts, which are proven using the definition of the limit and special limit results (including the famous \(\lim_{x \to 0} \frac{\sin x}{x} = 1\)):
$$\frac{d}{dx}\sin(x) = \cos(x)$$
$$\frac{d}{dx}\cos(x) = -\sin(x)$$
Read these carefully. The derivative of sine is cosine — no minus sign. The derivative of cosine is negative sine — the sign flips. That asymmetry is worth memorizing explicitly, because confusing them is the most common error in trig differentiation.
From these two rules, every other trig derivative can be derived algebraically — using the quotient rule for tangent and cotangent, and the chain rule for secant and cosecant.
All Six Trig Derivatives
Here's the complete list. You should eventually have all six memorized:
| Function | Derivative |
|---|---|
| \(\sin(x)\) | \(\cos(x)\) |
| \(\cos(x)\) | \(-\sin(x)\) |
| \(\tan(x)\) | \(\sec^2(x)\) |
| \(\cot(x)\) | \(-\csc^2(x)\) |
| \(\sec(x)\) | \(\sec(x)\tan(x)\) |
| \(\csc(x)\) | \(-\csc(x)\cot(x)\) |
Notice the pattern: the three functions starting with "co-" (cosine, cotangent, cosecant) all pick up a negative sign. That's a useful memory aid.
Now let's see where the bottom four come from.
Deriving Tangent and Cotangent
Since \(\tan(x) = \frac{\sin(x)}{\cos(x)}\), we can differentiate it using the quotient rule:
$$\frac{d}{dx}\left[\frac{f}{g}\right] = \frac{f'g - fg'}{g^2}$$
Applying it to tangent with \(f = \sin(x)\) and \(g = \cos(x)\):
$$\frac{d}{dx}\tan(x) = \frac{\cos(x) \cdot \cos(x) - \sin(x) \cdot (-\sin(x))}{\cos^2(x)}$$
$$= \frac{\cos^2(x) + \sin^2(x)}{\cos^2(x)}$$
The numerator is the Pythagorean identity \(\sin^2(x) + \cos^2(x) = 1\):
$$= \frac{1}{\cos^2(x)} = \sec^2(x)$$
So \(\frac{d}{dx}\tan(x) = \sec^2(x)\). The same approach works for cotangent. Since \(\cot(x) = \frac{\cos(x)}{\sin(x)}\):
$$\frac{d}{dx}\cot(x) = \frac{-\sin(x) \cdot \sin(x) - \cos(x) \cdot \cos(x)}{\sin^2(x)}$$
$$= \frac{-(\sin^2(x) + \cos^2(x))}{\sin^2(x)} = \frac{-1}{\sin^2(x)} = -\csc^2(x)$$
Deriving Secant and Cosecant
Since \(\sec(x) = \frac{1}{\cos(x)} = [\cos(x)]^{-1}\), we differentiate using the chain rule:
$$\frac{d}{dx}[\cos(x)]^{-1} = -1 \cdot [\cos(x)]^{-2} \cdot (-\sin(x))$$
$$= \frac{\sin(x)}{\cos^2(x)}$$
Now split this into two pieces by writing \(\frac{\sin(x)}{\cos^2(x)} = \frac{\sin(x)}{\cos(x)} \cdot \frac{1}{\cos(x)}\):
$$= \tan(x) \cdot \sec(x)$$
So \(\frac{d}{dx}\sec(x) = \sec(x)\tan(x)\).
The derivation of cosecant is identical in structure. Since \(\csc(x) = [\sin(x)]^{-1}\):
$$\frac{d}{dx}[\sin(x)]^{-1} = -1 \cdot [\sin(x)]^{-2} \cdot \cos(x) = \frac{-\cos(x)}{\sin^2(x)}$$
$$= -\frac{\cos(x)}{\sin(x)} \cdot \frac{1}{\sin(x)} = -\cot(x)\csc(x)$$
So \(\frac{d}{dx}\csc(x) = -\csc(x)\cot(x)\).
A Visual Perspective
The relationship between sine and cosine is more than algebraic — it's visible in their graphs. Since the derivative of sine is cosine, the cosine function tells you the rate of change of sine at every point.

Look at the first marked point (near \(x = 2\pi\)): the cosine is at zero. Since cosine is the derivative of sine, this tells you sine is neither increasing nor decreasing — it's at a peak or valley. And indeed it is.
At the second marked point (near \(x = 3\pi\)): the cosine is negative. Since cosine is the derivative of sine, this means sine is decreasing there. Which it is.
This kind of graphical reasoning — using one function to understand the behavior of another — is one of the most powerful tools in calculus.
Using the Chain Rule
When the argument of a trig function is something more than just \(x\), you need the chain rule. The pattern is:
$$\frac{d}{dx}\sin(u) = \cos(u) \cdot u'$$
where \(u\) is whatever expression is inside the trig function, and \(u'\) is its derivative. The same pattern applies to all six trig functions — differentiate the outer trig function, then multiply by the derivative of the inner expression.
For example:
$$\frac{d}{dx}\sin(3x) = \cos(3x) \cdot 3 = 3\cos(3x)$$
$$\frac{d}{dx}\cos(x^2) = -\sin(x^2) \cdot 2x = -2x\sin(x^2)$$
$$\frac{d}{dx}\tan(5x) = \sec^2(5x) \cdot 5 = 5\sec^2(5x)$$
$$\frac{d}{dx}\sec(4x) = \sec(4x)\tan(4x) \cdot 4 = 4\sec(4x)\tan(4x)$$
The outer rule gives you the trig derivative; the inner derivative is the factor you multiply by. Don't forget it.
Worked Examples
Example 1: Basic derivative
Find \(f'(x)\) if \(f(x) = 3\sin(x) - 2\cos(x)\).
Differentiate term by term:
$$f'(x) = 3\cos(x) - 2(-\sin(x)) = 3\cos(x) + 2\sin(x)$$
Example 2: Chain rule with sine
Find \(\frac{d}{dx}\sin(7x)\).
$$\frac{d}{dx}\sin(7x) = \cos(7x) \cdot 7 = 7\cos(7x)$$
Example 3: Chain rule with cosine
Find \(\frac{d}{dx}\cos(x^3)\).
$$\frac{d}{dx}\cos(x^3) = -\sin(x^3) \cdot 3x^2 = -3x^2\sin(x^3)$$
Example 4: Product rule + trig
Find \(\frac{d}{dx}[x^2 \sin(x)]\).
Use the product rule \((fg)' = f'g + fg'\):
$$\frac{d}{dx}[x^2\sin(x)] = 2x\sin(x) + x^2\cos(x)$$
Example 5: Chain rule with tangent
Find \(\frac{d}{dx}\tan(2x + 1)\).
$$\frac{d}{dx}\tan(2x+1) = \sec^2(2x+1) \cdot 2 = 2\sec^2(2x+1)$$
Example 6: Mixed function
Find \(g'(x)\) if \(g(x) = \sec(x) + 4\cot(x)\).
$$g'(x) = \sec(x)\tan(x) + 4(-\csc^2(x)) = \sec(x)\tan(x) - 4\csc^2(x)$$
Example 7: Evaluating at a point
If \(f(x) = \cos(x) - \sin(x)\), find \(f'!\left(\frac{\pi}{2}\right)\).
First find \(f'(x)\):
$$f'(x) = -\sin(x) - \cos(x)$$
Now substitute \(x = \frac{\pi}{2}\):
$$f'!\left(\frac{\pi}{2}\right) = -\sin!\left(\frac{\pi}{2}\right) - \cos!\left(\frac{\pi}{2}\right) = -1 - 0 = -1$$
Practice Problems
Find \(\frac{d}{dx}[5\cos(x)]\).
Show answer\(\frac{d}{dx}[5\cos(x)] = 5 \cdot (-\sin(x)) = -5\sin(x)\)
Find \(\frac{d}{dx}[\sin(4x)]\).
Show answerChain rule: \(\cos(4x) \cdot 4 = 4\cos(4x)\)
Find \(\frac{d}{dx}[\tan(x^2)]\).
Show answerChain rule: \(\sec^2(x^2) \cdot 2x = 2x\sec^2(x^2)\)
Find \(\frac{d}{dx}[3\sin(x) + \cot(x)]\).
Show answer\(3\cos(x) + (-\csc^2(x)) = 3\cos(x) - \csc^2(x)\)
Find \(\frac{d}{dx}[x\cos(x)]\).
Show answerProduct rule: \((1)\cos(x) + x(-\sin(x)) = \cos(x) - x\sin(x)\)
Find \(\frac{d}{dx}[\sec(3x)]\).
Show answerChain rule: \(\sec(3x)\tan(3x) \cdot 3 = 3\sec(3x)\tan(3x)\)
If \(f(x) = \sin(x)\), find \(f'!\left(\frac{\pi}{6}\right)\).
Show answer\(f'(x) = \cos(x)\), so \(f'!\left(\frac{\pi}{6}\right) = \cos!\left(\frac{\pi}{6}\right) = \frac{\sqrt{3}}{2}\)
You can verify any of these with our Derivative Calculator.