# Derivative of sec²x: Formula, Proof and Examples

> The derivative of sec²x is 2sec²x tan x. See two proofs, one with the chain rule and one with 1 + tan²x, plus examples like sec²(3x).

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

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

## At a glance

- **Derivative:** $2\sec^2 x\tan x$ for $x \ne \frac{\pi}{2} + k\pi$
- **In sin and cos:** $\dfrac{2\sin x}{\cos^3 x}$
- **Chain rule form:** $\dfrac{d}{dx}\sec^2 u = 2\sec^2 u\tan u\cdot u'$
- **Relation to tan x:** $\sec^2 x$ is the derivative of $\tan x$, so this is $\frac{d^2}{dx^2}\tan x$
- **Integral of sec²x:** $\int \sec^2 x\,dx = \tan x + C$

## Key takeaways

- The derivative of $\sec^2 x$ is $2\sec^2 x\tan x$.
- Treat $\sec^2 x$ as $(\sec x)^2$: the outer square gives $2\sec x$, the inner gives $\sec x\tan x$.
- Since $\sec^2 x = \frac{d}{dx}\tan x$, this result is also the second derivative of $\tan x$.
- Do not confuse it with the derivative of $\tan x$, which is $\sec^2 x$ itself.

The **derivative of $\sec^2 x$ is $2\sec^2 x\tan x$**. Read $\sec^2 x$ as $(\sec x)^2$, then apply the chain rule once.

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

## Graph of sec²x and its derivative

```graph
title: 'Graph of y = sec²x and its derivative y = 2sec²x tan x'
caption: 'The U-shaped branch of $\sec^2 x$ has its minimum at $x = 0$, where the derivative crosses zero.'
x: [-1.6, 1.6]
y: [-8, 8]
functions:
  - expr: sec(x)^2
    label: y = sec²x
    domain: [-1.25, 1.25]
  - expr: 2sec(x)^2tan(x)
    label: y = 2sec²x tan x (derivative)
    dashed: true
    domain: [-1.0, 1.0]
vertical:
  - x: 1.5708
    label: x = π/2
  - x: -1.5708
    label: x = -π/2
points:
  - [0, 1, 'minimum, slope 0']
```

## Proof 1: chain rule on (sec x)²

The outer function is the square, the inner function is $\sec x$. Using the [chain rule](/rules/chain-rule) and the [derivative of sec x](/derivatives/sec-x):

$$\frac{d}{dx}(\sec x)^2 = 2\sec x\cdot\frac{d}{dx}\sec x = 2\sec x\cdot\sec x\tan x = 2\sec^2 x\tan x$$

## Proof 2: using 1 + tan²x

The identity $\sec^2 x = 1 + \tan^2 x$ gives a second route. The $1$ drops out, and $\tan^2 x$ is a square of $\tan x$:

$$\frac{d}{dx}\left(1 + \tan^2 x\right) = 2\tan x\cdot\sec^2 x$$

Both routes agree, which is a good check on the identity.

## Proof 3: in terms of cos x

$\sec^2 x = (\cos x)^{-2}$, so

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

Split it as $2\cdot\frac{1}{\cos^2 x}\cdot\frac{\sin x}{\cos x} = 2\sec^2 x\tan x$.

## Why this is the second derivative of tan x

The [derivative of tan x](/derivatives/tan-x) is $\sec^2 x$. So differentiating $\sec^2 x$ is the same as differentiating $\tan x$ twice:

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

The sign of this tells you the concavity of $\tan x$: concave down for $-\frac{\pi}{2} < x < 0$ and concave up for $0 < x < \frac{\pi}{2}$.

## Chain rule variants

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

**Example 1.** $\frac{d}{dx}\sec^2(3x) = 6\sec^2(3x)\tan(3x)$.

**Example 2.** $\frac{d}{dx}\sec^2(x^2) = 4x\sec^2(x^2)\tan(x^2)$.

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

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

## Where you will meet it

The derivative of $\sec^2 x$ comes up most often in two places. The first is finding the concavity and inflection points of $\tan x$, since $\sec^2 x$ is its first derivative. The second is in integration, where recognizing $2\sec^2 x\tan x$ as a derivative lets you undo it quickly with u-substitution: setting $u = \tan x$ turns $\int 2\tan x\sec^2 x\,dx$ into $\int 2u\,du = \tan^2 x + C$. Since $\tan^2 x$ and $\sec^2 x$ differ only by $1$, that is the same family of antiderivatives.

## Common mistakes

1. **Stopping at $2\sec x$.** That is only the outer derivative. Multiply by $\sec x\tan x$.
2. **Answering $\tan x$.** $\tan x$ is the integral of $\sec^2 x$, not its derivative. See the [integral of sec²x](/integrals/sec-squared-x).
3. **Treating $\sec^2 x$ as $\sec(x^2)$.** $\frac{d}{dx}\sec(x^2) = 2x\sec(x^2)\tan(x^2)$, which is different.

Squares of sine and cosine follow the same pattern: see the [derivative of sin²x](/derivatives/sin-squared-x) and [derivative of cos²x](/derivatives/cos-squared-x).

## Frequently asked questions

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

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

### What is the second derivative of tan x?

The first derivative is $\sec^2 x$, and its derivative is $2\sec^2 x\tan x$. So $\frac{d^2}{dx^2}\tan x = 2\sec^2 x\tan x$.

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

By the chain rule, $2\sec(2x)\cdot\sec(2x)\tan(2x)\cdot 2 = 4\sec^2(2x)\tan(2x)$.

### Is the derivative of sec²x equal to tan x?

No, that is backward. $\tan x$ is the antiderivative of $\sec^2 x$. The derivative of $\sec^2 x$ is $2\sec^2 x\tan x$.
