Skip to content
ihateDesmos

Derivative of sec x

Updated 6 November 2026 · Checked numerically by the ihateDesmos engine
The derivative of sec x
ddx(sec(x))=sec(x)tan(x)

The derivative of sec x is sec x tan x. It follows from writing sec x as 1/cos x and differentiating.

−3−2−1123−550
Open in calculator
y=sec(x)
in blue and its derivative
y=sec(x)tan(x)
in red. Defined for x ≠ π/2 + nπ.

How to find the derivative of sec x

Method: chain rule.

  1. 1
    Write sec x as a power: sec x = (cos x)⁻¹.
  2. 2
    Apply the chain rule: −1 · (cos x)⁻² · (−sin x).
  3. 3
    Simplify the signs: sin x / cos²x.
  4. 4
    Split it into two fractions: (1/cos x) · (sin x / cos x).
  5. 5
    That is sec x tan x.

What it means on the graph

The secant has a U-shaped branch around x = 0 with a minimum of 1. At that point the slope is 0, and sec x tan x is 0 because tan 0 = 0. The slope is negative to the left of the minimum and positive to the right.

In the window shown, the derivative is zero at x = −π, x = 0, x = π. Those are the points where the graph of sec x has a horizontal tangent.

Table of values

The derivative column uses the formula. The last column estimates the slope directly from the original function, as an independent check.

Values of sec x and its derivative
xsec xsec x tan xSlope, measured
−6/52.7597−7.09838−7.09838
−π/4√2−√2−√2
0100
π/62√3/32/32/3
π/4√2√2√2
6/52.75977.098387.09838

Second derivative

Differentiating once more gives:

d2dx2(sec(x))=sec(x)tan(x)2+sec(x)3

The second derivative tells you which way the graph bends: positive means it curves upward, and negative means it curves downward.

Related derivatives

The same result with the chain or product rule. Each of these is checked numerically too.

Related derivatives
FunctionDerivative
sec(2x)
2sec(2x)tan(2x)
sec(x)2
2sec(x)2tan(x)

Common mistakes

  • Confusing it with the derivative of tan x, which is sec²x.
  • Adding a minus sign. Only the “co-” functions have negative derivatives.

Frequently asked questions

What is the derivative of sec x?
The derivative of sec x is sec x tan x, for x ≠ π/2 + nπ.
What is the second derivative of sec x?
Differentiate sec x tan x again to get the second derivative. The result is shown on this page under “Second derivative”.
What is the derivative of sec²x?
2 sec²x tan x, by the chain rule: bring down the 2, keep sec x, then multiply by the derivative of sec x.

Keep going

Differentiate any function

Type your own function into the derivative calculator and see every rule applied, step by step.

Open the derivative calculator