Derivative of tan²(x)
tan²(x) means (tan x)². It appears constantly in integration through the identity tan²=sec²−1, and its derivative is one chain-rule step away.
Step-by-step solution
tan²(x)=(tan x)². Let u=tan(x); the outer function is u². In the calculator, type tan(x)^2.
The outer derivative is 2u=2tan(x). The inner derivative is (tan x)′=sec²(x).
f′(x)=2tan(x)sec²(x). Using sec²=1+tan², this can also be written 2tan(x)(1+tan²(x)).
Domain and graph behavior
tan(x) is undefined where cos(x)=0, so the function and its derivative exist for x≠π/2+kπ. The function is never negative and has period π. Its only zeros, at x=kπ, are minima: the derivative 2tan(x)sec²(x) changes from negative to positive there. Between consecutive asymptotes the graph is a U shape that rises to +∞ on both sides.
Second derivative
Product rule on 2tan(x)sec²(x): f″(x)=2sec⁴(x)+4tan²(x)sec²(x)=2sec²(x)(3sec²(x)−2). That is always positive, so tan²(x) is concave up on every interval of its domain. At x=0, f″(0)=2, so near the origin tan²(x)≈x².
Common mistake
Do not confuse tan²(x) with tan(x²). For tan²(x) the inner function is tan(x), giving 2tan(x)sec²(x). For tan(x²) the inner function is x², giving 2x·sec²(x²). The two answers differ everywhere except at x=0.
Practice problems
Differentiate tan²(3x)
Answer: 6tan(3x)sec²(3x): outer 2tan(3x), then sec²(3x), then the factor 3.
Differentiate tan³(x)
Answer: 3tan²(x)sec²(x): the power rule lowers the exponent, then multiply by sec²(x).
Why tan²(x) matters in integration
Since tan²(x)=sec²(x)−1, the antiderivative is tan(x)−x+C. Checking it is a good habit: d/dx[tan(x)−x]=sec²(x)−1=tan²(x). Without the identity there is no direct power rule for ∫tan²(x)dx, which is why this rewrite is taught alongside the derivative.
Same derivative as sec²(x)
tan²(x) and sec²(x) differ by the constant 1, so their graphs are vertical shifts of each other and their slopes match at every x. The sec²(x) solution reaches 2sec²(x)tan(x) by differentiating secant instead of tangent.
A numerical check
At x=π/4, tan=1 and sec²=2, so f′(π/4)=4. At x=π/3, tan=√3 and sec²=4, so f′(π/3)=8√3≈13.856. Centered secants with h=0.0001 match both values to at least four decimal places. The steep slope at π/3 reflects how quickly tan² grows as x approaches the asymptote at π/2.
Tangent line at x=π/4
A typical exam follow-up asks for the tangent line. At x=π/4, tan²(π/4)=1 and the slope is 4, so the line is y=1+4(x−π/4). Near that point the curve lies above this line, because the second derivative is positive. Using y=tan(x) as a shorthand, the slope rule reads d(y²)/dx=2y(1+y²), which lets you find slopes from a tangent value alone: where tan(x)=2, the slope of tan²(x) is 2·2·5=20.
More worked variations
tan(x²): 2x·sec²(x²), for comparison with the main example.
x·tan²(x): tan²(x)+2x·tan(x)sec²(x).
tan²(x)−sec²(x): the constant −1, so the derivative is 0.
Questions students ask
Is 2tan(x)sec²(x) the same as 2sin(x)/cos³(x)?
Yes. tan(x)=sin(x)/cos(x) and sec²(x)=1/cos²(x), so the product is 2sin(x)/cos³(x) wherever cos(x)≠0.
Where is the derivative of tan²(x) zero?
Only where tan(x)=0, at x=kπ, because sec²(x) is never zero. Those points are the minima of the graph.
See it: graph, values and a tangent line
Blue is tan²(x); dashed orange is 2·tan(x)·sec²(x). Squaring turns the negative half of tan(x) upward, so the graph is a U-shaped valley that touches 0 at the origin and rises toward ∞ at x = ±π/2.
Because tan²(x) = sec²(x) − 1, this graph is sec²(x) moved down by exactly 1, and the two functions have the same derivative.
Down into the valley and back out
| x | f(x) | f′(x) | f is… |
|---|---|---|---|
| −π/3 | 3 | −8√3 | falling |
| −π/4 | 1 | −4 | falling |
| 0 | 0 | 0 | valley (flat) |
| π/4 | 1 | 4 | rising |
| π/3 | 3 | 8√3 | rising |
Tangent line at x = π/4
Height: f(π/4) = 1. Slope: f′(π/4) = 4.
Point-slope form: y − 1 = 4·(x − π/4), so the tangent line is y ≈ 4x − 2.1416.
Compare tan(x) at the same point: both have height 1 there, but tan²(x) climbs twice as fast (slope 4 against 2), because squaring doubles the rate of change.
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)). It is positive for every x in the window, so the curve bends upward everywhere and the origin is its only turning point.
Related trigonometric derivatives
Review the chain rule and the trigonometric derivatives guide, or read our verification method and limitations.