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

\frac{d}{dx}\sin x = \lim_{h \to 0} \frac{\sin(x + h) - \sin x}{h}

The key is to expand \sin(x + h) using the angle addition formula:

\sin(x + h) = \sin x \cos h + \cos x \sin h

Substitute into the difference quotient:

\frac{\sin(x+h) - \sin x}{h} = \frac{\sin x \cos h + \cos x \sin h - \sin x}{h}

Group the \sin x terms together and factor:

= \frac{\sin x(\cos h - 1) + \cos x \sin h}{h}

Split into two separate fractions:

= \sin x \cdot \frac{\cos h - 1}{h} + \cos x \cdot \frac{\sin h}{h}

Now take h \to 0 and use the two standard limits. These are results you have already proved in the article on Standard Limits:

\lim_{h \to 0} \frac{\sin h}{h} = 1, \qquad \lim_{h \to 0} \frac{\cos h - 1}{h} = 0

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:

\frac{d}{dx}\sin x = \sin x \cdot 0 + \cos x \cdot 1 = \cos x

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:

\frac{d}{dx}\cos x = \lim_{h \to 0} \frac{\cos(x+h) - \cos x}{h}

Expand \cos(x+h) using the angle addition formula:

\cos(x+h) = \cos x \cos h - \sin x \sin h

Substitute and group:

\frac{\cos(x+h) - \cos x}{h} = \frac{\cos x \cos h - \sin x \sin h - \cos x}{h}
= \frac{\cos x(\cos h - 1) - \sin x \sin h}{h}
= \cos x \cdot \frac{\cos h - 1}{h} - \sin x \cdot \frac{\sin h}{h}

Take h \to 0 and apply the same two standard limits:

\frac{d}{dx}\cos x = \cos x \cdot 0 - \sin x \cdot 1 = -\sin x

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 solid black curve is $y = \cos x$ and the dashed red curve is its derivative $y = -\sin x$. At $x = 0$, the cosine is at its peak and the derivative is $-\sin 0 = 0$ — flat at the top. At $x = \pi/2$, the cosine crosses zero and the derivative is $-1$ — steepest downward slope. The minus sign in the derivative captures the fact that cosine is *falling* where sine is positive.

The four-cycle

There is a beautiful pattern here. Differentiating the trigonometric functions cycles through them:

\sin x \xrightarrow{\;d/dx\;} \cos x \xrightarrow{\;d/dx\;} -\sin x \xrightarrow{\;d/dx\;} -\cos x \xrightarrow{\;d/dx\;} \sin x

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 solid black curve is $y = \sin x$ and the dashed red curve is its derivative $y = \cos x$. Wherever the sine curve reaches a peak or trough, the cosine (the slope) is zero. Wherever the sine is steepest (crossing zero), the cosine has its extreme value. The derivative function is the slope-recording function: it tells you the tilt of the original at every point.

The remaining four: tan, cot, sec, csc

The other four trig functions are all built from \sin x and \cos x:

\tan x = \frac{\sin x}{\cos x}, \quad \cot x = \frac{\cos x}{\sin x}, \quad \sec x = \frac{1}{\cos x}, \quad \csc x = \frac{1}{\sin x}

Their derivatives all follow from the quotient rule. Recall that the quotient rule says:

\frac{d}{dx}\left(\frac{u}{v}\right) = \frac{v \cdot u' - u \cdot v'}{v^2}

Derivative of tan x

\frac{d}{dx}\tan x = \frac{d}{dx}\frac{\sin x}{\cos x} = \frac{\cos x \cdot \cos x - \sin x \cdot (-\sin x)}{\cos^2 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:

= \frac{\cos^2 x + \sin^2 x}{\cos^2 x} = \frac{1}{\cos^2 x} = \sec^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

\frac{d}{dx}\cot x = \frac{d}{dx}\frac{\cos x}{\sin 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{-(\sin^2 x + \cos^2 x)}{\sin^2 x} = \frac{-1}{\sin^2 x} = -\csc^2 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

\frac{d}{dx}\sec x = \frac{d}{dx}\frac{1}{\cos x} = \frac{\cos x \cdot 0 - 1 \cdot (-\sin x)}{\cos^2 x} = \frac{\sin x}{\cos^2 x}

Now rewrite this as a product of recognisable pieces:

\frac{\sin x}{\cos^2 x} = \frac{1}{\cos x} \cdot \frac{\sin x}{\cos x} = \sec x \tan x

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

\frac{d}{dx}\csc x = \frac{d}{dx}\frac{1}{\sin x} = \frac{\sin x \cdot 0 - 1 \cdot \cos x}{\sin^2 x} = \frac{-\cos x}{\sin^2 x}

Rewrite:

\frac{-\cos x}{\sin^2 x} = -\frac{1}{\sin x} \cdot \frac{\cos x}{\sin x} = -\csc x \cot x

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.

The solid black curve is $y = \tan x$ and the dashed red curve is its derivative $y = \sec^2 x$. The derivative is always positive and always at least $1$, confirming that the tangent function is always increasing. Near $x = \pi/2$, both the function and its derivative blow up — the curve becomes nearly vertical, and the slope heads to infinity.

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.

\frac{d}{dx}\tan x = \sec^2 x

Why: derived above from the quotient rule applied to \sin x / \cos x.

Step 2. Evaluate at x = \pi/4.

\sec^2\!\left(\frac{\pi}{4}\right) = \frac{1}{\cos^2(\pi/4)} = \frac{1}{(1/\sqrt{2})^2} = \frac{1}{1/2} = 2

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.

\tan\!\left(\frac{\pi}{4}\right) = 1

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.

y - 1 = 2\left(x - \frac{\pi}{4}\right)
y = 2x - \frac{\pi}{2} + 1 \approx 2x - 0.571

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 curve $y = \tan x$ near $x = \pi/4$, with its tangent line in red. The slope of $2$ means the tangent rises twice as fast as the horizontal — steeper than a $45°$ line, which would have slope $1$. As $x$ approaches $\pi/2 \approx 1.57$, the curve shoots upward and the slope ($\sec^2 x$) grows without bound.

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.

\theta(t) = \frac{\pi}{6}\cos(2t)

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.

\frac{d\theta}{dt} = \frac{\pi}{6} \cdot \frac{d}{dt}\cos(2t)

The derivative of \cos(u) is -\sin(u), and the inner function u = 2t has derivative 2:

\frac{d}{dt}\cos(2t) = -\sin(2t) \cdot 2 = -2\sin(2t)

Why: the chain rule multiplies the outer derivative (-\sin) by the inner derivative (2).

Step 3. Combine the constant with the derivative.

\frac{d\theta}{dt} = \frac{\pi}{6} \cdot (-2\sin(2t)) = -\frac{\pi}{3}\sin(2t)

Why: \frac{\pi}{6} \times 2 = \frac{\pi}{3}, and the minus sign carries through.

Step 4. Evaluate at t = \pi/4.

2t = 2 \cdot \frac{\pi}{4} = \frac{\pi}{2}
\frac{d\theta}{dt}\bigg|_{t=\pi/4} = -\frac{\pi}{3}\sin\!\left(\frac{\pi}{2}\right) = -\frac{\pi}{3} \cdot 1 = -\frac{\pi}{3} \approx -1.047 \text{ rad/s}

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 solid black curve is the displacement $\theta(t) = \frac{\pi}{6}\cos(2t)$, and the dashed red curve is the angular velocity $\omega = \frac{d\theta}{dt} = -\frac{\pi}{3}\sin(2t)$. At $t = \pi/4$, the displacement passes through zero (the pendulum is at centre) while the velocity hits its most negative value — the pendulum is moving fastest, in the negative direction. When the displacement is at a peak, the velocity is zero: the pendulum momentarily stops before swinging back.

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:

\frac{d}{dx}\frac{\sin x}{1 + \cos x} = \frac{(1+\cos x)\cos x - \sin x(-\sin x)}{(1 + \cos x)^2} = \frac{\cos x + \cos^2 x + \sin^2 x}{(1+\cos x)^2} = \frac{\cos x + 1}{(1+\cos x)^2} = \frac{1}{1 + \cos x}

The Pythagorean identity simplified the numerator, just as it did for \tan x.

The solid black curve is $y = x\sin x$ (product of $x$ and $\sin x$), and the dashed red curve is its derivative $y = \sin x + x\cos x$ (from the product rule). The derivative is zero where the original has a peak — near $x \approx 2.03$ — confirming the computation. Functions like $x\sin x$ arise in damped oscillations and signal processing.

Common confusions

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:

Since the inscribed triangle fits inside the sector, which fits inside the circumscribed triangle:

\frac{1}{2}\sin h \;\leq\; \frac{1}{2}h \;\leq\; \frac{1}{2}\tan h

Divide everything by \frac{1}{2}\sin h (positive for small h > 0):

1 \;\leq\; \frac{h}{\sin h} \;\leq\; \frac{1}{\cos h}

Take reciprocals (flipping the inequalities):

\cos h \;\leq\; \frac{\sin h}{h} \;\leq\; 1

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:

\frac{\cos h - 1}{h} = \frac{(\cos h - 1)(\cos h + 1)}{h(\cos h + 1)} = \frac{\cos^2 h - 1}{h(\cos h + 1)} = \frac{-\sin^2 h}{h(\cos h + 1)}
= -\frac{\sin h}{h} \cdot \frac{\sin h}{\cos 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:

\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots

Differentiating term by term (each term is a power of x, so the power rule applies):

\frac{d}{dx}\sin x = 1 - \frac{3x^2}{3!} + \frac{5x^4}{5!} - \frac{7x^6}{7!} + \cdots

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:

\frac{d}{dx}\sin x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots

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: