Derivative of Tan x

The derivative of tan x equals sec squared x, needed to find slopes of tangent curves and solve optimization and related-rates problems.

ddxtanx=sec2x\frac{d}{dx}\tan x = \sec^2 x

Solve a problem with Derivative of Tan x

Type the problem. The solver will use Derivative of Tan x where Derivative of Tan x is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Derivative of Tan x takes
xx
Derivative of Tan x
SymbolMeaning
xxThe independent variable, typically representing an angle in radians; if you accidentally use degrees instead, your derivative will be off by a constant factor.

When to use it

Use this when you need the slope of y=anxy = an x at any point, or when differentiating a function that contains tangent.

Level

Usually taught in: Calculus I

Worked examples

1. Find the derivative of $y = \tan x$

Problem

Find the derivative of y=tanxy = \tan x with respect to xx.
  1. ddxtanx=ddx(sinxcosx)\frac{d}{dx}\tan x = \frac{d}{dx}\left(\frac{\sin x}{\cos x}\right)

    We rewrite tangent as a quotient so we can apply the quotient rule.

  2. =(cosx)(cosx)(sinx)(sinx)cos2x= \frac{(\cos x)(\cos x) - (\sin x)(-\sin x)}{\cos^2 x}

    The quotient rule gives us uvuvv2\frac{u'v - uv'}{v^2}. Here u=sinxu = \sin x with u=cosxu' = \cos x, and v=cosxv = \cos x with v=sinxv' = -\sin x.

  3. =cos2x+sin2xcos2x= \frac{\cos^2 x + \sin^2 x}{\cos^2 x}

    We distribute and simplify: (sinx)=+sinx-(-\sin x) = +\sin x.

  4. =1cos2x= \frac{1}{\cos^2 x}

    The Pythagorean identity states that cos2x+sin2x=1\cos^2 x + \sin^2 x = 1.

  5. =sec2x= \sec^2 x

    By definition, secx=1cosx\sec x = \frac{1}{\cos x}, so sec2x=1cos2x\sec^2 x = \frac{1}{\cos^2 x}.

Answer: dydx=sec2x\frac{dy}{dx} = \sec^2 x

This derivation shows why the formula works: tangent is a ratio, and the quotient rule combined with the Pythagorean identity gives us this elegant result. Understanding the derivation helps you remember the formula and recognize when to use it.

2. Find the derivative of $y = 5\tan(3x)$ using the chain rule

Problem

Find the derivative of y=5tan(3x)y = 5\tan(3x) with respect to xx.
  1. dydx=5ddxtan(3x)\frac{dy}{dx} = 5 \cdot \frac{d}{dx}\tan(3x)

    The constant 5 comes out front, and we need to differentiate tan(3x)\tan(3x).

  2. =5sec2(3x)ddx(3x)= 5 \cdot \sec^2(3x) \cdot \frac{d}{dx}(3x)

    Apply the chain rule: differentiate the outside function (tangent gives sec2\sec^2) and multiply by the derivative of the inside function 3x3x.

  3. =5sec2(3x)3= 5 \cdot \sec^2(3x) \cdot 3

    The derivative of 3x3x is 3.

  4. =15sec2(3x)= 15\sec^2(3x)

    Multiply the constants: 5×3=155 \times 3 = 15.

Answer: dydx=15sec2(3x)\frac{dy}{dx} = 15\sec^2(3x)

Whenever tangent's input is not just xx, the chain rule is essential. This example shows how to combine the derivative formula with the chain rule to handle more complex functions.

3. Rate of change of a rotating thermometer pointer

Problem

In a laboratory, a thermometer with a rotating pointer displays temperature readings. The pointer's angle (in radians) at time tt seconds is θ(t)=tan(0.2t)\theta(t) = \tan(0.2t). Find the rate of change of the pointer angle at t=3t = 3 seconds.
  1. dθdt=ddttan(0.2t)\frac{d\theta}{dt} = \frac{d}{dt}\tan(0.2t)

    We need the derivative of the angle with respect to time.

  2. =sec2(0.2t)ddt(0.2t)= \sec^2(0.2t) \cdot \frac{d}{dt}(0.2t)

    Apply the formula ddxtanx=sec2x\frac{d}{dx}\tan x = \sec^2 x along with the chain rule for the inner function.

  3. =sec2(0.2t)0.2= \sec^2(0.2t) \cdot 0.2

    The derivative of 0.2t0.2t is 0.20.2.

  4. dθdtt=3=0.2sec2(0.2×3)\frac{d\theta}{dt}\bigg|_{t=3} = 0.2 \cdot \sec^2(0.2 \times 3)

    Substitute t=3t = 3 seconds to find the instantaneous rate at this specific time.

  5. =0.2sec2(0.6)= 0.2 \cdot \sec^2(0.6)

    Compute the argument: 0.2×3=0.60.2 \times 3 = 0.6 radians.

  6. 0.2×(1.086)20.236 rad/s\approx 0.2 \times (1.086)^2 \approx 0.236 \text{ rad/s}

    Using a calculator, sec(0.6)1.086\sec(0.6) \approx 1.086, so sec2(0.6)1.179\sec^2(0.6) \approx 1.179, and 0.2×1.1790.2360.2 \times 1.179 \approx 0.236 radians per second.

Answer: dθdtt=30.236 rad/s\frac{d\theta}{dt}\bigg|_{t=3} \approx 0.236 \text{ rad/s}

This word problem demonstrates that derivatives of tangent appear naturally when measuring how quickly an angle or oscillating quantity changes over time. By combining the derivative formula with the chain rule, we found the exact rate of change at a specific moment.

Common mistakes

Where Derivative of Tan x usually goes wrong
Answer came out wrong
Writing ddxtanx=tan2x\frac{d}{dx}\tan x = \tan^2 x
The correct formula is ddxtanx=sec2x\frac{d}{dx}\tan x = \sec^2 x (secant squared, not tangent squared). Remember that secx=1cosx\sec x = \frac{1}{\cos x} is completely different from tanx=sinxcosx\tan x = \frac{\sin x}{\cos x}.
Writing ddxtan(2x)=sec2(2x)\frac{d}{dx}\tan(2x) = \sec^2(2x) and forgetting the chain rule
Always include the chain rule factor: ddxtan(2x)=sec2(2x)2=2sec2(2x)\frac{d}{dx}\tan(2x) = \sec^2(2x) \cdot 2 = 2\sec^2(2x).
Writing ddxtanx=secx\frac{d}{dx}\tan x = \sec x (missing the square)
The correct formula has a square: ddxtanx=sec2x\frac{d}{dx}\tan x = \sec^2 x, not secx\sec x. A key to remembering: the quotient rule on sinxcosx\frac{\sin x}{\cos x} produces sec2x\sec^2 x in the final simplified form.
The mistakeWhy it is wrongThe fix
Writing ddxtanx=tan2x\frac{d}{dx}\tan x = \tan^2 xThis confuses the tangent derivative with the power rule, as if you were differentiating tanx\tan x like (something)2(\text{something})^2.The correct formula is ddxtanx=sec2x\frac{d}{dx}\tan x = \sec^2 x (secant squared, not tangent squared). Remember that secx=1cosx\sec x = \frac{1}{\cos x} is completely different from tanx=sinxcosx\tan x = \frac{\sin x}{\cos x}.
Writing ddxtan(2x)=sec2(2x)\frac{d}{dx}\tan(2x) = \sec^2(2x) and forgetting the chain ruleYou apply the outer rule correctly but forget to multiply by the derivative of the inner function 2x2x.Always include the chain rule factor: ddxtan(2x)=sec2(2x)2=2sec2(2x)\frac{d}{dx}\tan(2x) = \sec^2(2x) \cdot 2 = 2\sec^2(2x).
Writing ddxtanx=secx\frac{d}{dx}\tan x = \sec x (missing the square)You remember that tangent derivatives involve secant but forget that the exponent is 2, not 1.The correct formula has a square: ddxtanx=sec2x\frac{d}{dx}\tan x = \sec^2 x, not secx\sec x. A key to remembering: the quotient rule on sinxcosx\frac{\sin x}{\cos x} produces sec2x\sec^2 x in the final simplified form.

Tips and when to use something else

  • Always write sec2x\sec^2 x, not secx\sec x and not tan2x\tan^2 x—the square is essential to the formula.
  • When you see tan(kx)\tan(kx) for any constant kk, do not forget the chain rule: multiply your answer by kk.
  • If a problem asks about tangent but is not asking for a derivative, use a different method instead—for example, use the Product Rule if you're multiplying tangent by another function, or integrate if you need an antiderivative.
  • The derivative sec2x\sec^2 x is always positive, so tanx\tan x is always increasing. This is why the graph of tangent gets steeper as it approaches its vertical asymptotes at odd multiples of π/2\pi/2.

Frequently asked questions

Why is the derivative of tan x equal to sec squared x?
Because tangent is sinxcosx\frac{\sin x}{\cos x}. When you apply the quotient rule, the numerator becomes cos2x+sin2x\cos^2 x + \sin^2 x, which equals 1 by the Pythagorean identity. The denominator is cos2x\cos^2 x, so you get 1cos2x=sec2x\frac{1}{\cos^2 x} = \sec^2 x.
How do I use the derivative of tangent in a problem?
Use it whenever you need the slope of y=tanxy = \tan x at a point, or when you are differentiating a more complex function containing tangent. For composite functions like tan(3x)\tan(3x) or 5tan(x2)5\tan(x^2), combine this derivative with the chain rule.
Is the derivative of tan x always positive?
Yes, because sec2x=1cos2x\sec^2 x = \frac{1}{\cos^2 x} is always positive (it is the reciprocal of a squared real number). This means tanx\tan x is always increasing, even though the curve has vertical asymptotes where it jumps from -\infty to ++\infty.
Can I use the derivative of tangent to solve optimization problems?
Yes. To find critical points where y=tanxy = \tan x has maximum or minimum slope, or to solve applied problems where a tangent function describes a quantity (like an angle or position), set dydx=sec2x\frac{dy}{dx} = \sec^2 x equal to values from your problem constraints.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18