Derivative of tan(x) is sec(x)^2

Answer

sec(x)2\mathrm{sec}\left(x\right)^{2}
sec(x)^2

Derivative of tan(x)

Rule Used
Trigonometric Rule
Steps
  1. Recognize the trigonometric function tan⁡(x)\tan(x). These six derivatives are standard; a cofunction (cos, cot, csc) picks up a minus sign.
  2. Apply the standard derivative: ddxtan⁡(x)\frac{d}{dx} \tan(x) = sec⁡(x)2\sec(x)^2.
  3. Final answer: sec⁡(x)2\sec(x)^2

The derivative of tan(x) is sec(x)^2 wherever cos(x) is not zero.

Instant step-by-step solution for tan(x)

Share this result
Share on X

Derivative of tan(x) = sec(x)^2 Solve step-by-step for free: https://derivativecalculatorai.com/derivative-of-tan-x

Derivative

tan(x) → sec(x)^2engine: sec(x)^2

Graph of the function and its derivative

f(x) f'(x)

The solid curve is f. The dashed curve is f′. Vertical gaps are asymptotes or jumps, not extra zeros.

Why the derivative has this form

That is the same function as 1/cos(x)^2, and the Pythagorean identity also writes it as 1 + tan(x)^2. The three forms agree on every interval where tangent itself is defined. They are not three different derivatives.

Tangent is the quotient sin(x)/cos(x). The quotient rule is what produces the square: the denominator of the rule is already cos(x)^2, and the numerator collapses to 1 because cos(x)^2 + sin(x)^2 = 1. A calculator that only prints "trigonometric rule" is skipping that algebra. The algebra is the reason the square has to be there.

Cosine is zero at the odd multiples of pi/2, and tangent has a vertical asymptote at each of those points. The derivative is undefined in the same places. Between the asymptotes, sec(x)^2 is always positive, so tangent is increasing on each interval where it exists. Near x = 0 the value is about 1, which matches the slope you see on the graph.

Quotient-rule derivation of sec(x)^2

  1. Write tan(x) as sin(x)/cos(x). Call the numerator u and the denominator v.
  2. Differentiate the pieces you already know: u' = cos(x) and v' = -sin(x).
  3. Apply the quotient rule (u/v)' = (u'v - uv') / v^2.
  4. Substitute: numerator = cos(x)·cos(x) - sin(x)·(-sin(x)) = cos(x)^2 + sin(x)^2.
  5. Replace the numerator with 1, using cos(x)^2 + sin(x)^2 = 1. The denominator stays cos(x)^2.
  6. Conclude d/dx tan(x) = 1/cos(x)^2. By the definition of secant, that is sec(x)^2.
  7. Optional check of the other form: 1 + tan(x)^2 = 1 + sin(x)^2/cos(x)^2 = (cos(x)^2 + sin(x)^2)/cos(x)^2 = sec(x)^2.

Worked example

Slope of tan(x) at x = pi/4

  1. sec(pi/4) = 1/cos(pi/4) = 1/(√2/2) = √2.
  2. Square it: sec(pi/4)^2 = 2. The slope of the tangent line is 2, not √2.
  3. tan(pi/4) = 1, so the tangent line is y - 1 = 2(x - pi/4).
  4. A secant from pi/4 to pi/4 + 0.001 has a slope near 2. It does not approach 1, which is what you would get from sec(x) without the square.

Answer: 2

Common mistakes

Answering sec(x) instead of sec(x)^2

sec(x) is the reciprocal of cosine. The quotient rule leaves cos(x)^2 in the denominator, so the reciprocal is squared. At x = pi/4 the wrong answer √2 is about 1.41, and the true slope is 2.

Using the derivative of arctan(x)

The derivative of arctan(x) is 1/(1 + x^2), a function that never exceeds 1 and is defined for every real x. sec(x)^2 is unbounded and has gaps at the asymptotes of tangent. Inverting a function does not invert its derivative.

Evaluating at x = pi/2

tan(pi/2) is undefined, so it has no slope there. sec(pi/2)^2 is undefined for the same reason: cosine is zero. The formula is only a derivative on the open intervals between consecutive asymptotes.

Frequently asked questions

What is the derivative of tan(x)?

The derivative of tan(x) is sec(x)^2, also written 1/cos(x)^2 or 1 + tan(x)^2, on every interval where cos(x) is not zero.

Why is the derivative of tan(x) equal to sec(x)^2?

tan(x) = sin(x)/cos(x). The quotient rule gives (cos(x)^2 + sin(x)^2)/cos(x)^2. The numerator is 1, and 1/cos(x)^2 is sec(x)^2.

Is the derivative of tan(x) defined at pi/2?

No. tan(x) has a vertical asymptote at pi/2, and at every odd multiple of pi/2. The derivative does not exist at those points.

What is the slope of tan(x) at pi/4?

sec(pi/4)^2 = 2. The tangent line at that point has slope 2 and passes through (pi/4, 1).