DerivCalc
Mathematically reviewed · Published November 9, 2026 · How answers are verified

Derivative of sec²(x)

sec²(x) is the derivative of tan(x), so differentiating it gives the second derivative of tangent. The chain rule does the work: square on the outside, secant on the inside.

Answer
2sec²(x)·tan(x)
Differentiate with respect to x
Try sec²(x) in the calculator →

Step-by-step solution

1
Read the notation

sec²(x)=(sec x)². Let u=sec(x); the outer function is u². In the calculator, type sec(x)^2.

2
Differentiate both layers

The outer derivative is 2u=2sec(x). The inner derivative is (sec x)′=sec(x)tan(x).

3
Multiply

f′(x) = 2sec(x)·sec(x)tan(x) = 2sec²(x)tan(x). In sine-cosine form this is 2sin(x)/cos³(x).

Domain and graph behavior

sec(x)=1/cos(x) is undefined where cos(x)=0, so the function and its derivative exist only for x≠π/2+kπ; each excluded point is a vertical asymptote. Because sec²(x)≥1, the graph never dips below y=1. The derivative is zero only where tan(x)=0, at x=kπ, and those are the minima with value 1. On (−π/2, π/2) the function decreases for x<0 and increases for x>0.

Second derivative

Differentiate 2sec²(x)tan(x) with the product rule: f″(x)=4sec²(x)tan²(x)+2sec⁴(x). Replacing tan² by sec²−1 gives f″(x)=2sec²(x)(3sec²(x)−2). Since sec²(x)≥1, the bracket is at least 1, so f″>0 everywhere in the domain: every branch is concave up. At x=0 the value is 2.

Common mistake

Do not stop at 2sec(x). The power rule handles the square, but the inner function sec(x) still has to be differentiated, and its derivative is sec(x)tan(x), not tan(x) or sec²(x). Leaving out that factor gives an answer that is wrong at every point except where it happens to match by accident.

Practice problems

Differentiate sec²(2x)

Answer: 4sec²(2x)tan(2x): the extra inner layer 2x contributes a factor of 2.

Differentiate x·sec²(x)

Answer: sec²(x)+2x·sec²(x)tan(x): product rule, using the result on this page for the second factor.

Why this is the second derivative of tan(x)

(tan x)′=sec²(x), so (tan x)″=(sec²x)′=2sec²(x)tan(x). The sign of this expression tells you where tangent bends: it is negative on (−π/2, 0), where tan is concave down, and positive on (0, π/2), where it is concave up. The origin is the inflection point of tangent. See the tan(x) solution for the first step.

Same derivative as tan²(x)

The identity sec²(x)=1+tan²(x) means sec²(x) and tan²(x) differ by the constant 1. Constants have derivative zero, so both functions have exactly the same derivative. Working the tan²(x) solution gives 2tan(x)sec²(x), which is the same expression written in a different order.

A product-rule check

Write sec²(x)=sec(x)·sec(x). The product rule gives sec(x)tan(x)·sec(x) + sec(x)·sec(x)tan(x) = 2sec²(x)tan(x). The power-rule factor 2 is just the two identical factors each contributing one term.

A numerical check

At x=π/4, sec²=2 and tan=1, so f′(π/4)=4. At x=π/6, sec²=4/3 and tan=1/√3, so f′(π/6)=8√3/9≈1.5396. Centered secants with h=0.0001 reproduce both values to five decimal places. Near x=π/2 the slope grows without bound, matching the asymptote.

More worked variations

sec³(x): 3sec²(x)·sec(x)tan(x)=3sec³(x)tan(x).

sec²(x²): the inner derivative 2x gives 4x·sec²(x²)tan(x²).

sec²(x)−tan²(x): this is the constant 1, so the derivative is 0.

Questions students ask

Is 2sin(x)/cos³(x) also correct?

Yes. sec²(x)=1/cos²(x) and tan(x)=sin(x)/cos(x), so 2sec²(x)tan(x)=2sin(x)/cos³(x) wherever cos(x)≠0.

Can the derivative of sec²(x) be negative?

Yes. sec²(x) is always positive, so the sign comes from tan(x): negative on (−π/2, 0) and on every interval shifted by π.

See it: graph, values and a tangent line

Blue is sec²(x), which is itself the derivative of tan(x); dashed orange is 2·sec²(x)·tan(x). So this page measures how fast the slope of tan(x) is changing.

−1.2−0.600.61.2f(x) = sec²(x)f′(x) = 2·sec²(x)·tan(x) (dashed)

The valley at x = 0 has height 1: tan(x) is never less steep than slope 1. Since sec²(x) = 1 + tan²(x), this graph is tan²(x) lifted up by exactly 1, and the two have the same derivative.

Down into the valley and back out

xf(x)f′(x)f is…
−π/34−8√3falling
−π/42−4falling
010valley (flat)
π/424rising
π/348√3rising

Tangent line at x = π/4

Height: f(π/4) = 2. Slope: f′(π/4) = 4.

Point-slope form: y − 2 = 4·(x − π/4), so the tangent line is y ≈ 4x − 1.1416.

At 45° cos²(x) = ½, so sec²(x) = 2, and it is climbing at slope 4.

Check it numerically

Rise over run across a tiny gap at x = π/4 (h = 0.00001): [f(0.7854 + h) − f(0.7854 − h)] / 2h ≈ 4, matching f′(π/4) = 4.

Second derivative

f″(x) = 2·sec²(x)·(1 + 3·tan²(x)). This is identical to the second derivative of tan²(x), as it must be for two functions that differ by a constant.

Related trigonometric derivatives

tan²(x)sec(x)tan(x)sin²(x)cos²(x)

Review the chain rule and the trigonometric derivatives guide, or read our verification method and limitations.