Calculus
Intermediate

Derivative of Tangent

Derivative of the tangent function.

Formula

ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2 x

Variables

xVariable

Example

The slope of tan x at x = 0 is sec²0 = 1.

How it works

The derivative of tan x tells you the instantaneous rate at which the tangent function changes as x changes. It comes from writing tan x as sin x / cos x and applying the quotient rule; after simplifying, the result is sec²x. Since sec x = 1/cos x, this also shows the slope grows very quickly near angles where cos x is close to 0.

When to use it

Use this rule whenever you need the slope of a curve involving tan x, or when differentiating expressions that contain tangent as part of a larger function. It is especially useful in physics, engineering, and calculus problems involving angles, periodic behavior, and trig-based models.

Worked example, step by step

Find the derivative of f(x) = 5tan x - 3 f'(x) = 5(d/dx)(tan x) - d/dx(3) f'(x) = 5sec²x - 0 f'(x) = 5sec²x So the derivative is 5sec²x.

Common mistakes to avoid

  • Writing the derivative of tan x as sec x instead of sec²x
  • Forgetting the chain rule when the input is something like tan(3x)
  • Confusing sec²x with (sec x)² and dropping the square entirely

Did You Know?

The derivative of tan x is sec²x, which is never negative — tangent is always increasing between its asymptotes.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026