# 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.

Source: https://practicecalculus.com/blog/derivatives-of-trig-functions
Updated: 2026-10-02

## Key takeaways

- The six rules: $(\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$.
- Every function that starts with "c" (cos, cot, csc) has a minus sign in its derivative.
- The graph of $\cos x$ is exactly the slope of the graph of $\sin x$ at every point.
- These formulas only hold when $x$ is measured in radians.
- With an inside function, multiply by its derivative: $\frac{d}{dx}\sin(3x) = 3\cos(3x)$.

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:

$$\frac{d}{dx}\sin x = \cos x \qquad \frac{d}{dx}\cos x = -\sin x$$

$$\frac{d}{dx}\tan x = \sec^2 x \qquad \frac{d}{dx}\cot x = -\csc^2 x$$

$$\frac{d}{dx}\sec x = \sec x \tan x \qquad \frac{d}{dx}\csc x = -\csc x \cot x$$

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.

```graph
title: 'Graph of y = sin x and y = cos x, showing cos x as the slope of sin x'
caption: 'Where $\sin x$ is flat (at $x = \frac{\pi}{2}$), $\cos x = 0$. Where $\sin x$ climbs fastest (at $x = 0$), $\cos x = 1$. Where it falls fastest (at $x = \pi$), $\cos x = -1$.'
x: [-1, 7]
y: [-1.5, 2.2]
functions:
  - expr: sin(x)
    label: y = sin x
  - expr: cos(x)
    label: y = cos x
    dashed: true
points:
  - [0, 1, 'cos 0 = 1']
  - [1.5708, 0, 'cos(π/2) = 0']
  - [3.1416, -1, 'cos π = -1']
```

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](/blog/limit-definition-of-the-derivative) and the identity $\sin(x+h) = \sin x \cos h + \cos x \sin h$:

$$\frac{d}{dx}\sin x = \lim_{h \to 0} \frac{\sin x \cos h + \cos x \sin h - \sin x}{h}$$

Group the $\sin x$ terms:

$$= \sin x \cdot \lim_{h \to 0}\frac{\cos h - 1}{h} + \cos x \cdot \lim_{h \to 0}\frac{\sin h}{h}$$

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](/blog/product-and-quotient-rules) produces them.

**Tangent.** With $\tan x = \frac{\sin x}{\cos x}$:

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

**Secant.** With $\sec x = \frac{1}{\cos x}$ (the top is the constant 1, whose derivative is 0):

$$(\sec x)' = \frac{0 \cdot \cos x - 1 \cdot (-\sin x)}{\cos^2 x} = \frac{\sin x}{\cos^2 x} = \frac{1}{\cos x}\cdot\frac{\sin x}{\cos x} = \sec x \tan x$$

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:

$$y' = 3\cos(3x)$$

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](/blog/chain-rule).

## 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.**

$$y' = 2\cos x \cdot (-\sin x) = -2\sin x \cos x$$

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.

$$y' = 4\sec(4x)\tan(4x)$$

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$:

$$y' = 1 \cdot \cos x + x \cdot(-\sin x) = \cos x - x\sin 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.**

$$y = -\frac{\pi}{2}\left(x - \frac{\pi}{2}\right) = -\frac{\pi}{2}x + \frac{\pi^2}{4}$$

```graph
title: 'Graph of y = x cos x with its tangent line at x = π/2'
caption: 'At $x = \frac{\pi}{2}$ the slope of $x\cos x$ is $-\frac{\pi}{2}$, giving the tangent line $y = -\frac{\pi}{2}x + \frac{\pi^2}{4}$.'
x: [-1, 5]
y: [-4, 3]
functions:
  - expr: x cos(x)
    label: y = x cos x
  - expr: -(pi/2) x + pi^2/4
    label: tangent at x = π/2
    dashed: true
points:
  - [1.5708, 0, '(π/2, 0)']
```

## 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.**

$$y' = \cos x - \sin x$$

**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:

$$\sin x \;\to\; \cos x \;\to\; -\sin x \;\to\; -\cos x \;\to\; \sin x$$

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

1. **Dropping the minus sign.** $(\cos x)' = -\sin x$, not $\sin x$. Remember: "co" functions get a minus.
2. **Forgetting the inside derivative.** $\frac{d}{dx}\sin(3x) = 3\cos(3x)$, not $\cos(3x)$.
3. **Changing the inside.** $\frac{d}{dx}\tan(x^2)$ is $2x\sec^2(x^2)$, not $\sec^2(2x)$.
4. **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)$.
5. **Using degrees.** A calculator in degree mode will make every numerical check look wrong.
6. **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.

## Frequently asked questions

### What is the derivative of sin x?

The derivative of $\sin x$ is $\cos x$. You can see it on the graph: wherever $\sin x$ is steepest going up (at $x = 0$) the cosine is 1, and wherever $\sin x$ is flat (at its peaks and valleys) the cosine is 0.

### Why is the derivative of cos x negative sin x?

Just after $x = 0$, $\cos x$ starts going down while $\sin x$ is positive, so the slope must be the negative of the sine. Formally it comes from the limit definition and the identity $\cos(x+h) = \cos x \cos h - \sin x \sin h$.

### What is the derivative of tan x?

The derivative of $\tan x$ is $\sec^2 x$, which is the same as $\frac{1}{\cos^2 x}$. You get it by writing $\tan x = \frac{\sin x}{\cos x}$ and using the quotient rule.

### Do trig derivatives work in degrees?

Not as written. The rule $(\sin x)' = \cos x$ assumes radians. In degrees you get an extra factor of $\frac{\pi}{180}$, which is why calculus always uses radians.

### How do you remember the six trig derivatives?

Learn sine, tangent and secant, then get the "co" versions by swapping each function for its cofunction and adding a minus sign. For example $\sec x \tan x$ becomes $-\csc x \cot x$.
