Derivative of Tan 2x - Formula, Proof, and Examples

#Trigonometry
TL;DR
The derivative of tan 2x is $\dfrac{d}{dx}(\tan 2x) = 2\sec^2 2x$. This article proves that result three ways — chain rule, first principle, and quotient rule — works through examples, and clears up the most common confusion: $\tan 2x$ (double angle) versus $\tan^2 x$ (tangent squared), which have different derivatives.
BT
Bhanzu TeamLast updated on July 15, 20267 min read

What Is the Derivative of Tan 2x?

The derivative of tan 2x with respect to $x$ is:

$$\dfrac{d}{dx}(\tan 2x) = 2\sec^2 2x$$

Here $\sec$ is the secant function, the reciprocal of cosine: $\sec\theta = \dfrac{1}{\cos\theta}$. The result comes from the standard derivative $\dfrac{d}{dx}(\tan u) = \sec^2 u$ combined with the chain rule, because $\tan 2x$ is a composite function — a tangent wrapped around an inner function $2x$.

Before any proof, name the pieces:

  • Outer function: $\tan u$, whose derivative is $\sec^2 u$.

  • Inner function: $u = 2x$, whose derivative is $2$.

That inner derivative of 2 is the factor everyone drops. This article belongs to the wider family of differentiation of trigonometric functions, which share the same chain-rule pattern.

How Do You Prove the Derivative of Tan 2x?

Three proofs land on the same answer. Seeing more than one is the point — the chain rule is fastest, but the first principle shows why it works.

Proof 1 - Chain Rule

The chain rule says $\dfrac{d}{dx}f(g(x)) = f'(g(x)) \cdot g'(x)$. With $f(u) = \tan u$ and $g(x) = 2x$:

$$\dfrac{d}{dx}(\tan 2x) = \sec^2(2x) \cdot \dfrac{d}{dx}(2x)$$ $$= \sec^2(2x) \cdot 2$$ $$= 2\sec^2 2x$$

Proof 2 - Quotient Rule

Write $\tan 2x = \dfrac{\sin 2x}{\cos 2x}$ and apply the quotient rule $\left(\dfrac{u}{v}\right)' = \dfrac{u'v - uv'}{v^2}$, remembering that $\dfrac{d}{dx}(\sin 2x) = 2\cos 2x$ and $\dfrac{d}{dx}(\cos 2x) = -2\sin 2x$:

$$\dfrac{d}{dx}\left(\dfrac{\sin 2x}{\cos 2x}\right) = \dfrac{(2\cos 2x)(\cos 2x) - (\sin 2x)(-2\sin 2x)}{\cos^2 2x}$$ $$= \dfrac{2\cos^2 2x + 2\sin^2 2x}{\cos^2 2x}$$ $$= \dfrac{2(\cos^2 2x + \sin^2 2x)}{\cos^2 2x}$$

Using $\cos^2\theta + \sin^2\theta = 1$:

$$= \dfrac{2}{\cos^2 2x} = 2\sec^2 2x$$

Proof 3 - First Principle

The first principle uses the limit definition $f'(x) = \displaystyle\lim_{h \to 0} \dfrac{f(x+h) - f(x)}{h}$. With $f(x) = \tan 2x$:

$$f'(x) = \lim_{h \to 0} \dfrac{\tan(2x + 2h) - \tan 2x}{h}$$

Combine the tangents over a common form using $\tan A - \tan B = \dfrac{\sin(A - B)}{\cos A \cos B}$, with $A = 2x + 2h$ and $B = 2x$:

$$f'(x) = \lim_{h \to 0} \dfrac{1}{h} \cdot \dfrac{\sin(2h)}{\cos(2x + 2h)\cos 2x}$$

Split off the standard limit $\displaystyle\lim_{h \to 0}\dfrac{\sin 2h}{2h} = 1$:

$$f'(x) = \lim_{h \to 0} \dfrac{\sin 2h}{2h} \cdot \dfrac{2}{\cos(2x + 2h)\cos 2x}$$

As $h \to 0$, the first factor is 1 and $\cos(2x + 2h) \to \cos 2x$:

$$f'(x) = \dfrac{2}{\cos^2 2x} = 2\sec^2 2x$$

All three agree: $\boxed{\dfrac{d}{dx}(\tan 2x) = 2\sec^2 2x}$

Examples of the Derivative of Tan 2x

Example 1: Differentiate $y = \tan 2x$ and find the slope at $x = 0$.

$$\dfrac{dy}{dx} = 2\sec^2 2x$$

At $x = 0$: $\sec 0 = \dfrac{1}{\cos 0} = 1$, so $\dfrac{dy}{dx} = 2(1)^2 = 2$.

Final answer: slope $= 2$.

Example 2: Differentiate $y = \tan 2x$ versus $y = \tan^2 x$. Wrong path first.

The tempting move is to assume these are the same thing because both have a "2" and a tangent.

Try treating $\tan^2 x$ as if it were $\tan 2x$ and writing its derivative as $2\sec^2 x$. Test it: $\tan^2 x = (\tan x)^2$ is a square, so its derivative must come from the power rule, not the double-angle pattern. The answers cannot match.

The rescue is to differentiate each correctly:

For $\tan 2x$ (chain rule): $\dfrac{d}{dx}(\tan 2x) = 2\sec^2 2x$.

For $\tan^2 x$ (power rule + chain rule), with $u = \tan x$:

$$\dfrac{d}{dx}(\tan x)^2 = 2\tan x \cdot \sec^2 x$$

Final answer: $\tan 2x \to 2\sec^2 2x$; $\tan^2 x \to 2\tan x,\sec^2 x$. Different functions, different derivatives.

Example 3: Differentiate $y = \tan(2x + 1)$.

The inner function is $2x + 1$, whose derivative is still 2:

$$\dfrac{dy}{dx} = \sec^2(2x + 1) \cdot 2 = 2\sec^2(2x + 1)$$

Final answer: $2\sec^2(2x + 1)$.

Example 4: Differentiate $y = \tan(\tan 2x)$.

Two nested chain rules. The outer derivative is $\sec^2(\tan 2x)$; multiply by the derivative of the inner $\tan 2x$, which is $2\sec^2 2x$:

$$\dfrac{dy}{dx} = \sec^2(\tan 2x) \cdot 2\sec^2 2x = 2\sec^2(\tan 2x),\sec^2 2x$$

Final answer: $2\sec^2(\tan 2x),\sec^2 2x$.

Example 5: Differentiate $y = \tan 2x + \sec 2x$.

Differentiate term by term. Recall $\dfrac{d}{dx}(\sec 2x) = 2\sec 2x \tan 2x$:

$$\dfrac{dy}{dx} = 2\sec^2 2x + 2\sec 2x \tan 2x$$

Final answer: $2\sec^2 2x + 2\sec 2x\tan 2x$.

Example 6: Find the second derivative of $y = \tan 2x$.

First derivative: $y' = 2\sec^2 2x$. Differentiate again, treating $\sec^2 2x = (\sec 2x)^2$ with the chain rule:

$$y'' = 2 \cdot 2\sec 2x \cdot (2\sec 2x \tan 2x) = 8\sec^2 2x \tan 2x$$

Final answer: $y'' = 8\sec^2 2x \tan 2x$.

The first-instinct error students reach for across these is dropping the inner derivative of 2 — the chain rule is the habit that, once it becomes automatic, stops the answer coming out half-size.

Why This Derivative Matters - "Recording a doubled rate of change"

The reason this derivative earns attention is that the factor of 2 is not cosmetic. Differentiation measures rate of change, and $\tan 2x$ varies twice as fast as $\tan x$ because its angle advances twice as quickly. The derivative has to carry that doubling, which is exactly what the chain-rule 2 does.

  • Physics of oscillation. When a quantity's phase moves at double speed, its instantaneous rate doubles — the 2 is the honest bookkeeping of that.

  • The general lesson. Every composite function hides an inner derivative. $\tan 2x$ is a clean place to learn never to skip it, because the omission is so easy to spot once you know to look.

This is why the topic is taught early in calculus: it is a small, repeatable case of the rule that governs nearly every later derivative.

Common Mistakes With the Derivative of Tan 2x

Mistake 1: Forgetting the chain-rule factor of 2

Where it slips in: Differentiating any composite where the inner function is $2x$.

Don't do this: Writing $\dfrac{d}{dx}(\tan 2x) = \sec^2 2x$ and stopping.

The correct way: Multiply by the inner derivative: $2\sec^2 2x$.

The first-instinct error is differentiating the outer function and treating the inner function as if it were a bare $x$ — the chain rule exists precisely to stop that, and $\tan 2x$ is where most students first feel the cost of skipping it.

Mistake 2: Confusing tan 2x with tan²x

Where it slips in: Reading the notation too fast.

Don't do this: Treating $\tan 2x$ and $\tan^2 x$ as the same function.

The correct way: $\tan 2x$ is tangent of the angle $2x$ (a double angle); $\tan^2 x$ is $(\tan x)^2$ (a square). Their derivatives are $2\sec^2 2x$ and $2\tan x,\sec^2 x$ respectively.

The memorizer who pattern-matches on the digits "2" and "tan" gets these backwards; the fix is to read what the 2 is attached to — the angle or the whole function.

Mistake 3: Wrong derivative for the secant term

Where it slips in: Differentiating $\sec 2x$ alongside $\tan 2x$.

Don't do this: Writing $\dfrac{d}{dx}(\sec 2x) = \sec^2 2x$ (borrowing the tangent rule).

The correct way: $\dfrac{d}{dx}(\sec u) = \sec u \tan u \cdot u'$, so $\dfrac{d}{dx}(\sec 2x) = 2\sec 2x\tan 2x$.

Key Takeaways

  • The derivative of tan 2x is $2\sec^2 2x$.

  • The factor of 2 is the chain rule acting on the inner function $2x$.

  • It can be proved by the chain rule, the quotient rule, or the first principle — all agree.

  • $\tan 2x$ (double angle) and $\tan^2 x$ (square) are different and differentiate differently.

  • In general, $\dfrac{d}{dx}(\tan nx) = n\sec^2 nx$.

To master the derivative of tan 2x with a teacher, explore Bhanzu's trigonometry tutor sessions, a high school math tutor for calculus practice, or live math classes online with peers from 20+ countries.

A Practical Next Step

Practice these to solidify your understanding: differentiate $\tan 3x$, then $\tan^2(2x)$, naming the rule you use each time. If you get stuck on the inner factor, come back to the chain-rule proof above. Want a live Bhanzu trainer to check your working? Book a free demo class.

Read More

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is the derivative of tan 2x?
$2\sec^2 2x$. The 2 comes from the chain rule applied to the inner function $2x$.
Is the derivative of tan 2x the same as the derivative of tan²x?
No. $\tan 2x$ gives $2\sec^2 2x$; $\tan^2 x$ gives $2\tan x,\sec^2 x$. They are different functions.
Can I prove it without the chain rule?
Yes — the quotient rule on $\dfrac{\sin 2x}{\cos 2x}$ and the first-principle limit both give the same $2\sec^2 2x$, shown above.
What is the derivative of tan(nx) in general?
$\dfrac{d}{dx}(\tan nx) = n\sec^2 nx$. The chain-rule factor is whatever multiplies $x$ inside.
Why is the answer always positive?
$\sec^2 2x$ is a square, so it is never negative, and multiplying by the positive 2 keeps it so — tan 2x is increasing wherever it is defined.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →