In short
The derivative of \sin x is \cos x, and the derivative of \cos x is -\sin x. From these two, the derivatives of all six trigonometric functions follow by the quotient rule. Each derivative is proved here — no memorisation without understanding.
Point a laser beam at a wall. Tilt the beam slowly upward from horizontal. At first the bright dot on the wall creeps up gently. But as the beam gets closer to pointing straight up, the dot races up the wall faster and faster — until, just before vertical, a tiny tilt sends the dot flying off to infinity.
That dot traces out \tan\theta — the tangent function — as \theta changes. And the speed at which it moves is the derivative of \tan\theta. The fact that the dot accelerates without bound as \theta approaches 90° is telling you something specific: the derivative of \tan\theta is \sec^2\theta, which blows up at \theta = \pi/2.
But that is getting ahead of things. The story begins with the simplest trig function of all.
The derivative of sin x from first principles
This is the foundational derivation. Every other trig derivative will flow from this one.
You want to compute
The key is to expand \sin(x + h) using the angle addition formula:
Substitute into the difference quotient:
Group the \sin x terms together and factor:
Split into two separate fractions:
Now take h \to 0 and use the two standard limits. These are results you have already proved in the article on Standard Limits:
The first limit says that \sin h and h are essentially the same size when h is tiny — their ratio approaches exactly 1. The second says that \cos h is very close to 1 when h is tiny — so close that the difference \cos h - 1 shrinks faster than h itself. (Both limits require h to be in radians. This is one reason calculus always uses radians.)
Apply both limits to the expression:
That is the result: the derivative of \sin x is \cos x.
Read what this means geometrically. The sine curve starts at the origin heading upward. At x = 0, the slope is \cos 0 = 1 — the curve rises at a 45° angle. At x = \pi/6, the slope is \cos(\pi/6) = \sqrt{3}/2 \approx 0.866 — still rising, but less steeply. At x = \pi/2, the slope is \cos(\pi/2) = 0 — the curve is flat at the peak. At x = \pi, the slope is \cos\pi = -1 — the curve is falling at 45°. The derivative \cos x records these slopes as a function, and that function is itself a familiar wave — the same shape as the sine curve, just shifted a quarter period to the left.
The derivative of cos x from first principles
The same approach works for cosine. Start from the definition:
Expand \cos(x+h) using the angle addition formula:
Substitute and group:
Take h \to 0 and apply the same two standard limits:
The derivative of \cos x is -\sin x. Note the minus sign — it is not optional, and it appears naturally from the subtraction in the cosine addition formula. The cosine curve starts at its peak (value 1) and falls, so the slope is negative immediately after x = 0: -\sin 0 = 0 (flat at the peak), then -\sin(\pi/6) = -1/2 (falling), then -\sin(\pi/2) = -1 (falling steeply). The minus sign encodes this falling behaviour.
The four-cycle
There is a beautiful pattern here. Differentiating the trigonometric functions cycles through them:
Four differentiations bring you back to the start. This means the fourth derivative of \sin x is \sin x itself — a property that no polynomial has. It is closely related to the fact that \sin x satisfies the differential equation y'' = -y: the second derivative of sine is the negative of sine.
This cycling pattern makes it easy to find any higher derivative. The n-th derivative of \sin x follows a repeating pattern based on n \bmod 4:
| n \bmod 4 | \dfrac{d^n}{dx^n}\sin x |
|---|---|
| 0 | \sin x |
| 1 | \cos x |
| 2 | -\sin x |
| 3 | -\cos x |
So the 99th derivative of \sin x? Since 99 = 4 \times 24 + 3, it is -\cos x.
The remaining four: tan, cot, sec, csc
The other four trig functions are all built from \sin x and \cos x:
Their derivatives all follow from the quotient rule. Recall that the quotient rule says:
Derivative of tan x
In the numerator, \cos x times \cos x gives \cos^2 x, and \sin x times (-\sin x) gives -\sin^2 x, but the quotient rule has a minus sign, so -(-\sin^2 x) = +\sin^2 x:
The Pythagorean identity \cos^2 x + \sin^2 x = 1 collapsed the numerator to 1. The result is \sec^2 x, which is always at least 1 — so the tangent function always has a slope of at least 1. This means \tan x is always increasing within each of its branches (between consecutive vertical asymptotes). Look at the graph of \tan x and you will see: the curve always goes upward, even at its gentlest point (x = 0, where the slope is \sec^2 0 = 1).
Derivative of cot x
The same Pythagorean identity, with a minus sign. The derivative is -\csc^2 x, always negative (or undefined) — meaning the cotangent function is always decreasing within each branch. This is the mirror image of tangent's behaviour.
Derivative of sec x
Now rewrite this as a product of recognisable pieces:
So \frac{d}{dx}\sec x = \sec x \tan x. This derivative is positive when \tan x > 0 (first and third quadrants, where \sec x is increasing) and negative when \tan x < 0 (second and fourth quadrants, where \sec x is decreasing), which matches the graph of the secant function perfectly.
Derivative of csc x
Rewrite:
So \frac{d}{dx}\csc x = -\csc x \cot x.
The complete table
Here are all six derivatives in one place:
| Function | Derivative | Domain of derivative |
|---|---|---|
| \sin x | \cos x | all x |
| \cos x | -\sin x | all x |
| \tan x | \sec^2 x | x \neq (2k+1)\frac{\pi}{2} |
| \cot x | -\csc^2 x | x \neq k\pi |
| \sec x | \sec x \tan x | x \neq (2k+1)\frac{\pi}{2} |
| \csc x | -\csc x \cot x | x \neq k\pi |
There is a pattern in the signs that makes the table easier to remember. The "co-" functions (\cos, \cot, \csc) all pick up a minus sign in their derivatives. The others (\sin, \tan, \sec) do not. This is not a coincidence — it traces back to the complementary angle relationship. Since \cos x = \sin(\pi/2 - x), differentiating with the chain rule gives -\cos(\pi/2 - x) = -\sin x. The minus sign comes from the chain rule applied to the \pi/2 - x inside, and this same mechanism produces the minus sign in every "co-" derivative.
Worked examples
Example 1: Slope of the tangent curve
Find the slope of the tangent line to y = \tan x at x = \pi/4, and write the equation of the tangent line.
Step 1. Recall the derivative of \tan x.
Why: derived above from the quotient rule applied to \sin x / \cos x.
Step 2. Evaluate at x = \pi/4.
Why: \cos(\pi/4) = 1/\sqrt{2}, so \cos^2(\pi/4) = 1/2, and the reciprocal of 1/2 is 2.
Step 3. Find the function value at x = \pi/4.
Why: \sin(\pi/4) = \cos(\pi/4), so their ratio is 1.
Step 4. Write the equation of the tangent line using point-slope form.
Why: the tangent line passes through the point (\pi/4, 1) with slope 2. Point-slope form is y - y_0 = m(x - x_0).
Result: The slope at x = \pi/4 is 2, and the tangent line is y = 2x - \frac{\pi}{2} + 1.
The tangent line touches the curve at exactly one point and has the same slope as the curve at that point. A little to the right of \pi/4, the curve starts to pull away from the tangent line and accelerate upward — consistent with the derivative \sec^2 x being an increasing function on (0, \pi/2).
Example 2: Rate of change in a pendulum
A pendulum swings so that its angular displacement at time t seconds is \theta(t) = \frac{\pi}{6}\cos(2t). Find the angular velocity \frac{d\theta}{dt} at time t = \pi/4 seconds.
Step 1. Write \theta(t) and identify the structure.
The constant \pi/6 multiplies the entire expression. Inside the cosine is 2t, not t — so differentiating will require the chain rule along with the cosine derivative.
Why: \pi/6 is the amplitude (maximum displacement is \pi/6 radians, or 30°), and the factor 2 inside the cosine controls the frequency.
Step 2. Differentiate using the derivative of cosine and the chain rule.
The derivative of \cos(u) is -\sin(u), and the inner function u = 2t has derivative 2:
Why: the chain rule multiplies the outer derivative (-\sin) by the inner derivative (2).
Step 3. Combine the constant with the derivative.
Why: \frac{\pi}{6} \times 2 = \frac{\pi}{3}, and the minus sign carries through.
Step 4. Evaluate at t = \pi/4.
Why: \sin(\pi/2) = 1, so the expression simplifies cleanly.
Result: The angular velocity at t = \pi/4 is -\frac{\pi}{3} \approx -1.047 radians per second.
The negative sign in the answer means the pendulum is swinging in the negative direction — back toward centre and beyond. The maximum angular speed is \pi/3 \approx 1.047 rad/s, which occurs when the pendulum passes through the equilibrium position (zero displacement). This makes physical sense: the pendulum moves fastest at the lowest point of its swing and is momentarily stationary at the extremes.
Applications: combining trig derivatives with differentiation rules
The six trig derivatives become much more powerful when combined with the product rule, quotient rule, and chain rule. Here are three patterns that appear constantly.
Pattern 1: Chain rule with a linear inner function. The derivative of \sin(ax + b) is a\cos(ax + b), and the derivative of \cos(ax + b) is -a\sin(ax + b). The factor a comes from the chain rule. This pattern appears in every oscillation problem in physics.
Pattern 2: Product rule with trig functions. The derivative of x\sin x is \sin x + x\cos x (product rule). The derivative of x^2\cos x is 2x\cos x - x^2\sin x. In each case, the product rule generates two terms, one from each factor.
Pattern 3: Quotient rule regenerating the table. The entire table above was derived using the quotient rule. The same approach works for any ratio of trig functions. For example, \frac{\sin x}{1 + \cos x} can be differentiated directly by the quotient rule:
The Pythagorean identity simplified the numerator, just as it did for \tan x.
Common confusions
-
"The derivative of \sin x is \cos x only when x is in radians." Correct, and this is critical. If \theta is in degrees, then \sin\theta° = \sin(\theta \cdot \pi/180), and by the chain rule the derivative is \frac{\pi}{180}\cos(\theta \cdot \pi/180). The extra factor \frac{\pi}{180} \approx 0.01745 would appear in every formula. Radians are not a convention — they are the unit that makes the limit \frac{\sin h}{h} \to 1 true, and that limit is the foundation of every derivative in this article.
-
"The derivative of \cos x is \sin x." Missing the minus sign. The derivative of \cos x is -\sin x. The minus sign comes directly from the first-principles derivation — from the -\sin x \cdot \sin h term in the expansion of \cos(x+h). A helpful mnemonic: the "co-" functions always introduce a minus sign.
-
"I proved \frac{d}{dx}\tan x = \sec^2 x using the quotient rule, but my textbook derives it from first principles." Some textbooks use the identity \tan(x+h) = \frac{\tan x + \tan h}{1 - \tan x \tan h} and compute the limit directly. Both methods give the same answer. The quotient-rule method is shorter and more elegant, but the first-principles method works independently of knowing \frac{d}{dx}\sin x and \frac{d}{dx}\cos x.
-
"\frac{d}{dx}\sin(3x) = \cos(3x)." Missing the chain rule factor. The correct answer is 3\cos(3x). The inner function 3x contributes a factor of 3. This is the most common error in trig differentiation.
-
"\frac{d}{dx}\sec^2 x = 2\sec x." No. By the chain rule, \frac{d}{dx}\sec^2 x = 2\sec x \cdot \sec x\tan x = 2\sec^2 x \tan x. The derivative of the inner function \sec x must be included.
Going deeper
If you came here to learn the six trig derivatives and see their proofs, you have them — you can stop here. The rest is for readers who want to understand why the limit \frac{\sin h}{h} \to 1 is true and see a connection to power series.
Why does \frac{\sin h}{h} \to 1?
The entire derivation of \frac{d}{dx}\sin x = \cos x rests on the limit \lim_{h \to 0}\frac{\sin h}{h} = 1. This limit is proved using a geometric squeeze argument.
Consider a unit circle (radius 1) and a small positive angle h (in radians). Three areas can be compared by nesting:
- The triangle inscribed in the sector has area \frac{1}{2}\sin h \cos h (base \cos h, height \sin h, but the simpler bound \frac{1}{2}\sin h suffices since \cos h < 1).
- The circular sector has area \frac{1}{2}h (for a unit circle, sector area equals half the angle in radians).
- The larger right triangle whose hypotenuse goes from the origin to the point where the terminal ray meets the vertical tangent line has area \frac{1}{2}\tan h.
Since the inscribed triangle fits inside the sector, which fits inside the circumscribed triangle:
Divide everything by \frac{1}{2}\sin h (positive for small h > 0):
Take reciprocals (flipping the inequalities):
As h \to 0^+, \cos h \to 1, so \frac{\sin h}{h} is squeezed between two quantities that both approach 1. By the sandwich theorem, \lim_{h \to 0^+}\frac{\sin h}{h} = 1.
For h < 0, note that \frac{\sin(-h)}{-h} = \frac{-\sin h}{-h} = \frac{\sin h}{h}, so the limit from the left equals the limit from the right.
This is why radians are essential. The sector area is \frac{1}{2}h only when h is in radians. In degrees, the sector area formula would be \frac{1}{2} \cdot \frac{\pi h}{180}, and the limit would be \frac{\pi}{180}, not 1.
Deriving the second standard limit from the first
The limit \lim_{h \to 0}\frac{\cos h - 1}{h} = 0 follows from \lim_{h \to 0}\frac{\sin h}{h} = 1:
As h \to 0: the first factor tends to 1, and the second tends to \frac{0}{1 + 1} = 0. The product tends to 0.
Connection to power series
The Madhava-Gregory series tradition gives another way to see the derivative. The power series for \sin x is:
Differentiating term by term (each term is a power of x, so the power rule applies):
Simplify each coefficient: \frac{3}{3!} = \frac{3}{6} = \frac{1}{2!}, and \frac{5}{5!} = \frac{5}{120} = \frac{1}{4!}, and \frac{7}{7!} = \frac{1}{6!}. So:
That last series is exactly the power series for \cos x. The derivative of \sin x is \cos x — confirmed by a completely different method, using pure algebra instead of limits.
Madhava of Sangamagrama discovered these series expansions in the 14th century, more than two centuries before they appeared in European mathematics. The series make the relationship between \sin and \cos visible in a way that the geometric definition alone does not — each function's series is the termwise derivative of the other's (with appropriate signs).
Where this leads next
Now that you can differentiate all six trig functions, the natural next steps are:
- Chain Rule — combining trig derivatives with the chain rule to differentiate \sin(3x), \tan(x^2), \sec(e^x), and any composite trig function.
- Derivatives of Inverse Trigonometric Functions — the derivatives of \sin^{-1}x, \tan^{-1}x, and their cousins, derived using implicit differentiation and the trig derivatives from this article.
- Derivatives of Exponential and Logarithmic Functions — the other family of transcendental derivatives, completing the differentiation toolkit.
- L'Hopital's Rule — using derivatives (including trig derivatives) to evaluate limits of indeterminate forms.
- Tangent and Normal — applying trig derivatives to find tangent and normal lines to trigonometric curves.