Derivatives of Trig Functions: All Six, With Proofs and Examples
The derivatives of sin, cos, tan, cot, sec and csc, why the derivative of sin x is cos x, and worked chain rule examples with trig functions.
By the PracticeCalculus team Published 7 min read
On this page
- The six trig derivatives
- Why the derivative of sin x is cos x: read it off the graph
- The proof from the limit definition
- Getting tan, cot, sec and csc from the quotient rule
- Worked example 1: trig with the chain rule
- Worked example 2: a power of a trig function
- Worked example 3: secant with an inside function
- Worked example 4: product rule with a trig function
- Worked example 5: where is the tangent line horizontal?
- Higher derivatives of sine and cosine repeat
- Common mistakes with trig derivatives
- Quick reference
- Practice them until they are reflexes
Trig functions show up everywhere in calculus: in waves, springs, rotating wheels and half the problems on your exam. To differentiate them you need six formulas, and the good news is that you only really need to understand two. The rest follow from the quotient rule, and a simple sign pattern helps you remember them all.
The six trig derivatives
A trig derivative is the rate of change of a trigonometric function. Here they are, with x in radians:
Look at the right column. Every function that starts with "co" (cosine, cotangent, cosecant) has a minus sign in its derivative. And each "co" rule is the matching left-column rule with every function swapped for its cofunction (\sin \leftrightarrow \cos, \tan \leftrightarrow \cot, \sec \leftrightarrow \csc) and a minus sign added.
Why the derivative of sin x is cos x: read it off the graph
Before any algebra, look at the graphs of \sin x and \cos x together.
Trace along the sine curve and estimate its slope:
- At x = 0, sine rises through the origin with slope 1. The cosine at 0 is 1.
- At x = \frac{\pi}{2}, sine reaches its peak and is momentarily flat. The cosine there is 0.
- At x = \pi, sine crosses downward as steeply as it ever falls, slope -1. The cosine at \pi is -1.
- At x = \frac{3\pi}{2}, sine bottoms out, slope 0. The cosine is 0 again.
At every point, the height of the cosine curve matches the slope of the sine curve. That is what (\sin x)' = \cos x means.
Do the same for cosine. Just to the right of x = 0, cosine is at its peak and starts falling, while sine is positive. So the slope of cosine is the negative of the sine: (\cos x)' = -\sin x.
The proof from the limit definition
The graph convinces; the limit proves. Using the limit definition of the derivative and the identity \sin(x+h) = \sin x \cos h + \cos x \sin h:
Group the \sin x terms:
Two famous limits finish it: \lim_{h\to 0}\frac{\sin h}{h} = 1 and \lim_{h \to 0}\frac{\cos h - 1}{h} = 0. So the derivative is \sin x \cdot 0 + \cos x \cdot 1 = \cos x.
That first limit equals 1 only in radians. In degrees it would be \frac{\pi}{180}, and every trig derivative would carry that awkward factor. This is the real reason calculus uses radians.
Getting tan, cot, sec and csc from the quotient rule
The other four are quotients of sine and cosine, so the quotient rule produces them.
Tangent. With \tan x = \frac{\sin x}{\cos x}:
Secant. With \sec x = \frac{1}{\cos x} (the top is the constant 1, whose derivative is 0):
Cotangent and cosecant work the same way, and the minus signs appear because the derivative of \cos x is negative.
Worked example 1: trig with the chain rule
Differentiate y = \sin(3x).
Step 1. Outside: \sin u. Inside: u = 3x.
Step 2. Differentiate the outside and keep the inside: \cos(3x).
Step 3. Multiply by the inside derivative, 3:
The same pattern gives \frac{d}{dx}\cos(5x) = -5\sin(5x) and \frac{d}{dx}\tan(x^2) = 2x\sec^2(x^2). For more practice spotting the inside, see the chain rule guide.
Worked example 2: a power of a trig function
Differentiate y = \cos^2 x, which means (\cos x)^2.
Step 1. Outer layer, the square. 2\cos x.
Step 2. Inner layer, the cosine. Its derivative is -\sin x.
Step 3. Multiply.
Using the double-angle identity 2\sin x\cos x = \sin(2x), this simplifies to y' = -\sin(2x).
Worked example 3: secant with an inside function
Differentiate y = \sec(4x).
Step 1. The derivative of \sec u is \sec u \tan u, so the outer part is \sec(4x)\tan(4x).
Step 2. The inside 4x has derivative 4.
Note that both the secant and the tangent keep the inside 4x.
Worked example 4: product rule with a trig function
Differentiate y = x\cos x, then find the tangent line at x = \frac{\pi}{2}.
Step 1. Product rule. With u = x and v = \cos x:
Step 2. Evaluate at x = \frac{\pi}{2}. The point is \left(\frac{\pi}{2}, \frac{\pi}{2}\cos\frac{\pi}{2}\right) = \left(\frac{\pi}{2}, 0\right). The slope is \cos\frac{\pi}{2} - \frac{\pi}{2}\sin\frac{\pi}{2} = 0 - \frac{\pi}{2} = -\frac{\pi}{2}.
Step 3. Tangent line.
Worked example 5: where is the tangent line horizontal?
Find every x in [0, 2\pi) where y = \sin x + \cos x has a horizontal tangent.
Step 1. Differentiate term by term.
Step 2. Set the derivative equal to zero. \cos x = \sin x. Dividing by \cos x (which cannot be zero here, since then \sin x would be \pm 1, not 0) gives \tan x = 1.
Step 3. Solve on the interval. \tan x = 1 at x = \frac{\pi}{4} and x = \frac{5\pi}{4}.
Step 4. Find the heights. At \frac{\pi}{4}, y = \frac{\sqrt{2}}{2} + \frac{\sqrt{2}}{2} = \sqrt{2}, the maximum. At \frac{5\pi}{4}, y = -\sqrt{2}, the minimum. So \sin x + \cos x is a wave that swings between -\sqrt{2} and \sqrt{2}, a fact you found with nothing more than the first two rules in the table.
Higher derivatives of sine and cosine repeat
Differentiate \sin x over and over:
The pattern repeats every four derivatives. So to find the 23rd derivative of \sin x, divide 23 by 4: the remainder is 3, so it matches the third derivative, -\cos x. This cycle is also why y = \sin x and y = \cos x solve the spring equation y'' = -y.
Common mistakes with trig derivatives
- Dropping the minus sign. (\cos x)' = -\sin x, not \sin x. Remember: "co" functions get a minus.
- Forgetting the inside derivative. \frac{d}{dx}\sin(3x) = 3\cos(3x), not \cos(3x).
- Changing the inside. \frac{d}{dx}\tan(x^2) is 2x\sec^2(x^2), not \sec^2(2x).
- Treating \sin^2 x like \sin(x^2). The first is (\sin x)^2, with derivative 2\sin x\cos x. The second has derivative 2x\cos(x^2).
- Using degrees. A calculator in degree mode will make every numerical check look wrong.
- Losing one factor of the secant rule. (\sec x)' = \sec x \tan x keeps the secant; it is not just \tan x.
Quick reference
| Function | Derivative | With inside g(x) |
|---|---|---|
| \sin x | \cos x | \cos(g(x))\,g'(x) |
| \cos x | -\sin x | -\sin(g(x))\,g'(x) |
| \tan x | \sec^2 x | \sec^2(g(x))\,g'(x) |
| \cot x | -\csc^2 x | -\csc^2(g(x))\,g'(x) |
| \sec x | \sec x \tan x | \sec(g(x))\tan(g(x))\,g'(x) |
| \csc x | -\csc x \cot x | -\csc(g(x))\cot(g(x))\,g'(x) |
Practice them until they are reflexes
You will use these six formulas for the rest of calculus, including in integration, where you read the table backwards. The fastest way to lock them in is to use them. The interactive lesson below mixes plain trig derivatives with chain rule and product rule versions, and gives instant feedback so a dropped minus sign gets caught the moment it happens.
Practice it now
Sine, cosine and tangent
Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.
Practice this lesson