# Derivative of sec x: Formula, Proof and Examples

> The derivative of sec x is sec x tan x. See the proof from 1/cos x, the chain rule for sec(u), a graph and worked examples like sec(2x) and x sec x.

Source: https://practicecalculus.com/derivatives/sec-x
Updated: 2026-11-06

$$ \frac{d}{dx}\,\sec x = \sec x\tan x $$

## At a glance

- **Derivative:** $\sec x\tan x$ for $x \ne \frac{\pi}{2} + k\pi$
- **In sin and cos:** $\dfrac{\sin x}{\cos^2 x}$
- **Chain rule form:** $\dfrac{d}{dx}\sec u = \sec u\tan u \cdot u'$
- **Slope at x = 0:** $\sec 0\tan 0 = 0$
- **Integral version:** $\int \sec x\tan x\,dx = \sec x + C$

## Key takeaways

- The derivative of $\sec x$ is $\sec x\tan x$.
- It follows from writing $\sec x = (\cos x)^{-1}$ and using the chain rule.
- With the chain rule, $\frac{d}{dx}\sec u = \sec u\tan u\cdot u'$.
- Reading it backward gives $\int\sec x\tan x\,dx = \sec x + C$.

The **derivative of $\sec x$ is $\sec x\tan x$**. Secant is the reciprocal of cosine, so its derivative comes straight from the [derivative of cos x](/derivatives/cos-x).

$$\frac{d}{dx}\,\sec x = \sec x\tan x$$

## Graph of sec x and its derivative

```graph
title: 'Graph of y = sec x and its derivative y = sec x tan x'
caption: 'One branch of $\sec x$. It has a minimum at $x = 0$, where the derivative is $0$. Left of $0$ the slope is negative, right of $0$ it is positive.'
x: [-1.6, 1.6]
y: [-6, 7]
functions:
  - expr: sec(x)
    label: y = sec x
    domain: [-1.4, 1.4]
  - expr: sec(x)tan(x)
    label: y = sec x tan x (derivative)
    dashed: true
    domain: [-1.25, 1.25]
vertical:
  - x: 1.5708
    label: x = π/2
  - x: -1.5708
    label: x = -π/2
points:
  - [0, 1, 'minimum, slope 0']
```

## Proof with the chain rule

Write $\sec x = (\cos x)^{-1}$. The [chain rule](/rules/chain-rule) with the power $-1$ outside and $\cos x$ inside gives

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

Split the fraction into two familiar pieces:

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

The [quotient rule](/rules/quotient-rule) on $\frac{1}{\cos x}$ gives the same thing: $\frac{0\cdot\cos x - 1\cdot(-\sin x)}{\cos^2 x} = \frac{\sin x}{\cos^2 x}$.

## The chain rule version: derivative of sec(u)

$$\frac{d}{dx}\,\sec u = \sec u\tan u\cdot u'$$

Both $\sec$ and $\tan$ keep the same inside.

| Function | Inside $u$ | Derivative |
| --- | --- | --- |
| $\sec(2x)$ | $2x$ | $2\sec(2x)\tan(2x)$ |
| $\sec(x^2)$ | $x^2$ | $2x\sec(x^2)\tan(x^2)$ |
| $\sec(3x + 1)$ | $3x + 1$ | $3\sec(3x + 1)\tan(3x + 1)$ |
| $\sec\left(\frac{1}{x}\right)$ | $\frac{1}{x}$ | $-\frac{1}{x^2}\sec\frac{1}{x}\tan\frac{1}{x}$ |

## Worked examples

**Example 1: a product.** $\frac{d}{dx}(x\sec x) = \sec x + x\sec x\tan x = \sec x(1 + x\tan x)$.

**Example 2: a power.** $\frac{d}{dx}\sec^3 x = 3\sec^2 x\cdot\sec x\tan x = 3\sec^3 x\tan x$.

**Example 3: a sum that simplifies.** $\frac{d}{dx}(\sec x + \tan x) = \sec x\tan x + \sec^2 x = \sec x(\tan x + \sec x)$. This neat result is the trick behind the [integral of sec x](/integrals/sec-x), $\ln\lvert\sec x + \tan x\rvert + C$.

**Example 4: a value.** At $x = \frac{\pi}{3}$, $\sec\frac{\pi}{3} = 2$ and $\tan\frac{\pi}{3} = \sqrt{3}$, so the slope is $2\sqrt{3} \approx 3.46$.

## How to remember it

Secant and tangent always travel together in calculus. The derivative of $\tan x$ is $\sec^2 x$, and the derivative of $\sec x$ is $\sec x\tan x$. One way to keep them straight: tangent's derivative has no tangent in it, while secant's derivative contains both functions once each. Checking a value also helps. At $x = 0$ secant has its minimum, so the slope must be zero, and indeed $\tan 0 = 0$.

## Common mistakes

1. **Writing $\tan^2 x$ or $\sec^2 x$.** The derivative of $\sec x$ is $\sec x\tan x$. $\sec^2 x$ is the derivative of $\tan x$.
2. **Adding a minus sign.** Secant is not a "co" function, so its derivative is positive. Compare with the [derivative of csc x](/derivatives/csc-x), $-\csc x\cot x$.
3. **Changing only one inside.** $\frac{d}{dx}\sec(5x) = 5\sec(5x)\tan(5x)$. Both factors keep $5x$.

Reading the result backward gives the [integral of sec x tan x](/integrals/sec-x-tan-x). The [reciprocal trig functions](/functions/reciprocal-trig-functions) page covers the graph of secant.

## Frequently asked questions

### What is the derivative of sec x?

The derivative of $\sec x$ is $\sec x\tan x$.

### How do you prove the derivative of sec x?

Write $\sec x = (\cos x)^{-1}$. The chain rule gives $-(\cos x)^{-2}\cdot(-\sin x) = \frac{\sin x}{\cos^2 x} = \frac{1}{\cos x}\cdot\frac{\sin x}{\cos x} = \sec x\tan x$.

### What is the derivative of sec(2x)?

By the chain rule, $2\sec(2x)\tan(2x)$.

### What is the derivative of sec²x?

It is $2\sec x\cdot\sec x\tan x = 2\sec^2 x\tan x$.
