# Integral of sec x tan x: Formula, Derivation and Examples

> The integral of sec x tan x is sec x + C. See why it reverses the derivative of sec x, how to spot it in disguise as sin x/cos² x, and substitution examples.

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

$$ \int \sec x\tan x\,dx = \sec x + C $$

## At a glance

- **Antiderivative:** $\sec x + C$
- **Same as:** $\int\dfrac{\sin x}{\cos^2 x}\,dx = \sec x + C$
- **Linear form:** $\int\sec(ax)\tan(ax)\,dx = \dfrac{1}{a}\sec(ax) + C$
- **Cosecant partner:** $\int\csc x\cot x\,dx = -\csc x + C$
- **From 0 to π/3:** $1$

## Key takeaways

- The integral of $\sec x\tan x$ is $\sec x + C$, because the derivative of $\sec x$ is $\sec x\tan x$.
- It often appears in disguise as $\frac{\sin x}{\cos^2 x}$.
- It is the key to substitutions with $u = \sec x$, such as $\int\sec^3 x\tan x\,dx$.
- Its partner is $\int\csc x\cot x\,dx = -\csc x + C$, with a minus sign.

The **integral of $\sec x\tan x$ is $\sec x + C$**. It is the reverse of one of the six basic trig derivatives, so it is worth knowing on sight.

$$\int \sec x\tan x\,dx = \sec x + C$$

## Graph of sec x tan x and its antiderivative

```graph
title: 'Area under y = sec x tan x from 0 to π/3, with the antiderivative y = sec x'
caption: 'The shaded area is $\sec\frac{\pi}{3} - \sec 0 = 2 - 1 = 1$. The dashed curve $y = \sec x$ has its minimum at $x = 0$, exactly where $\sec x\tan x$ crosses zero.'
x: [-1.6, 1.6]
y: [-4, 5]
functions:
  - expr: sec(x)tan(x)
    label: y = sec x tan x
    domain: [-1.2, 1.2]
  - expr: sec(x)
    label: y = sec x (antiderivative)
    dashed: true
    domain: [-1.35, 1.35]
shade: {expr: sec(x)tan(x), from: 0, to: 1.0472}
points:
  - [0, 1, '(0, 1)']
  - [1.0472, 2, '(π/3, 2)']
```

$\sec x\tan x$ is an odd function, so its antiderivative $\sec x$ is even.

## Derivation

1. Recall the [derivative of sec x](/derivatives/sec-x): $\frac{d}{dx}\sec x = \sec x\tan x$.
2. Reverse it: $\sec x$ is an antiderivative of $\sec x\tan x$.
3. Add $C$.

If you want to see where the derivative comes from, write $\sec x = (\cos x)^{-1}$ and use the [chain rule](/rules/chain-rule):

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

## Check by differentiating

$$\frac{d}{dx}(\sec x + C) = \sec x\tan x \checkmark$$

## Spotting it in disguise

The integral does not always arrive labelled. Each of these is $\sec x\tan x$:

| Integrand | Rewrite | Integral |
| --- | --- | --- |
| $\frac{\sin x}{\cos^2 x}$ | $\frac{1}{\cos x}\cdot\frac{\sin x}{\cos x}$ | $\sec x + C$ |
| $\frac{\tan x}{\cos x}$ | $\tan x\sec x$ | $\sec x + C$ |
| $\frac{\sin x}{1 - \sin^2 x}$ | $\frac{\sin x}{\cos^2 x}$ | $\sec x + C$ |

You can also solve the first row directly with $u = \cos x$: $\int\frac{\sin x}{\cos^2 x}\,dx = -\int u^{-2}\,du = u^{-1} + C = \sec x + C$.

## Definite integrals

$$\int_0^{\pi/3}\sec x\tan x\,dx = 2 - 1 = 1, \qquad \int_0^{\pi/4}\sec x\tan x\,dx = \sqrt{2} - 1 \approx 0.414$$

Over a symmetric interval like $\left[-\frac{\pi}{4}, \frac{\pi}{4}\right]$ the integral is $0$, because the integrand is odd.

## Substitution variants

$$\int\sec(ax + b)\tan(ax + b)\,dx = \frac{1}{a}\sec(ax + b) + C$$

**Example 1.** $\int\sec(5x)\tan(5x)\,dx = \frac{1}{5}\sec(5x) + C$.

**Example 2: powers of sec.** With $u = \sec x$, $du = \sec x\tan x\,dx$:

$$\int\sec^3 x\tan x\,dx = \int\sec^2 x\cdot(\sec x\tan x)\,dx = \int u^2\,du = \frac{\sec^3 x}{3} + C$$

**Example 3: odd powers of tan.** $\int\tan^3 x\sec x\,dx = \int(\sec^2 x - 1)\sec x\tan x\,dx = \frac{\sec^3 x}{3} - \sec x + C$.

**Example 4: the cosecant partner.** $\int\csc x\cot x\,dx = -\csc x + C$, since $\frac{d}{dx}\csc x = -\csc x\cot x$.

## Common mistakes

1. **Integrating each factor separately.** $\int\sec x\tan x\,dx$ is not $\ln\lvert\sec x + \tan x\rvert\cdot\ln\lvert\sec x\rvert$. Integrals do not split over products.
2. **Answering $\tan x$.** That is the integral of $\sec^2 x$. See the [integral of sec² x](/integrals/sec-squared-x).
3. **Answering $\csc x$ for the cosecant version.** It needs a minus sign: $-\csc x + C$.
4. **Missing the disguise.** Always try rewriting $\frac{\sin x}{\cos^2 x}$ before reaching for a harder method.

Practise on [trig integral problems](/practice-problems/trig-integrals).

## Frequently asked questions

### What is the integral of sec x tan x?

The integral of $\sec x\tan x$ is $\sec x + C$.

### What is the integral of sin x / cos² x?

Since $\frac{\sin x}{\cos^2 x} = \frac{1}{\cos x}\cdot\frac{\sin x}{\cos x} = \sec x\tan x$, the integral is $\sec x + C$.

### What is the integral of sec(2x) tan(2x)?

It is $\frac{1}{2}\sec(2x) + C$.

### What is the integral of csc x cot x?

It is $-\csc x + C$, because the derivative of $\csc x$ is $-\csc x\cot x$.
