The derivative (or differentiation) of tan x is sec^{2} x. In this post, we will learn how to find the derivative of tan x. We will use the limit definition of derivatives as well as the product or quotient rule of derivatives.

Table of Contents

**What is the Derivative of tan x**?

The derivative of tan x is denoted by the symbol d/dx(tan x) or (tan x)$’$ and it is equal to sec^{2 }x. Note that tan x can be expressed as (sin x/ cos x). Using this fact together with various trigonometric formulas, we will find the derivative of tan x by the method of

- First principle of derivatives
- Product rule of derivatives
- Quotient rule of derivatives
- Chain rule of derivatives.

**Derivative of tan x Formula**

The formula of the derivative of tan x is given below

- d/dx(tan x) = sec
^{2}x - (tan x)$’$ = sec
^{2}x

**Derivative of tan x from limit definition**

Proof of derivative of tan x is sec^{2 }x by limit definition. Let $f(x)=\tan x$. Then the derivative of f(x) from first principle / limit definition is given as follows:

$\dfrac{d}{dx}(f(x))$ $=\lim\limits_{h\to 0}\dfrac{f(x+h)-f(x)}{h}$

Thus we have:

**Derivative of tan x by Product Rule**

To obtain the derivative of tan x by product rule, let us first recall that rule. For two functions f(x), g(x), the derivative of the product fg is known as the product rule of derivatives which is provided below:

$\dfrac{d}{dx}\left(fg \right)=f \dfrac{dg}{dx} + g \dfrac{df}{dx}$

Proof of the derivative of tan x is sec^{2 }x by the product rule of derivatives: we will follow the below steps:

**Step 1:** At first, we express tan x as the product of two functions as follows

$\tan x=\dfrac{\sin x}{\cos x}=\sin x \cdot \sec x$

$\therefore \dfrac{d}{dx}(\tan x)$ $=\dfrac{d}{dx}(\sin x \cdot \sec x)$

**Step 2:** Now we use the above product rule of derivatives. So we have

$\dfrac{d}{dx}(\tan x)$ $=\sin x\dfrac{d}{dx}(\sec x)$ $+\sec x \dfrac{d}{dx}(\sin x)$

$=\sin x \cdot \sec x \tan x$ $+\sec x \cdot \cos x$

$=\sin x \cdot \dfrac{1}{\cos x} \cdot \dfrac{\sin x}{\cos x}$ $+\dfrac{1}{\cos x} \cdot \cos x$

$=\dfrac{\sin^2 x}{\cos^2 x}+1$

$=\dfrac{\sin^2 x+\cos^2 x}{\cos^2 x}$

$=\dfrac{1}{\cos^2 x}$ [∵ sin^{2} x+cos^{2 }x=1]

$=\sec^2 x$

So the derivative of tan x is sec^{2} x which is obtained by the product rule of derivatives.

**Derivative of tan x by Quotient Rule **

Recall, the quotient rule of derivatives: $\dfrac{d}{dx}\left(\dfrac{f}{g} \right)=$ $\dfrac{g\frac{df}{dx}-f\frac{dg}{dx}}{g^2}$, where f and g are two functions of x.

To prove the derivative of tan x is sec^{2 }x by the quotient rule of derivatives, we need to follow the below steps.

**Step 1:** Express tan x as the quotient of two functions. Note that we have

$\tan x=\dfrac{\sin x}{\cos x}$

$\therefore \dfrac{d}{dx}(\tan x)=\dfrac{d}{dx}(\dfrac{\sin x}{\cos x})$

**Step 2:** Use the above quotient rule of derivatives.

$\dfrac{d}{dx}(\tan x)$ $={\small \dfrac{\cos x \frac{d}{dx}(\sin x)-\sin x\frac{d}{dx}(\cos x)}{\cos^2 x}}$

**Step 3:** Simplify the above expression.

$=\dfrac{\cos x \cos x-\sin x(-\sin x)}{\cos^2 x}$

$=\dfrac{\cos^2 x+\sin^2 x}{\cos^2 x}$

$=\dfrac{1}{\cos^2 x}$ [∵ sin^{2} x+cos^{2 }x=1]

$=\sec^2 x$

Thus, we have obtained the derivative of tan x which is sec^{2 }x.

**Derivative of tan x by Chain Rule**

We know that we can express tan x as 1/cot x. Using this fact we can find the derivative of tan x by the chain rule.

Let z = cot x. So we have dz/dx= -cosec^{2} x

∴ d/dx(tan x) = d/dx(1/cot x) = d/dx(1/z)

⇒ d/dx(tan x) = d/dx(1/z)

= d/dz(1/z) . dz/dx, by the chain rule of derivatives

= d/dz(z^{-1}) . dz/dx

= (-z^{-1-1}) . (-cosec^{2} x) by the power rule of derivatives

= 1/z^{2} . cosec^{2} x

= 1/cot^{2} x . cosec^{2} x

= (sin^{2} x)/(cos^{2} x) . 1/sin^{2} x

= 1/ cos^{2}x

= sec^{2} x

**Solved Problems on Derivative of tan x**

**Question 1:** Find the derivative of tan(x^{2}).

**Solution:**

Let z =x^{2}. Thus, dz/dx =2x.

Now the derivative of tan(x^{2}) is

d/dx(tan x^{2}) = d/dz(tan z) · dz/ dx = sec^{2}z · 2x = 2x sec^{2}(x^{2}) as z=x^{2}.

Answer: The derivative of tan(x^{2}) is 2x sec^{2}(x^{2}).

**Question 2:** Find the derivative of tan x with respect to sin x.

**Solution:**

Let u=tan x and v=sin x. We need to find du/dv.

Now, du/dx = sec^{2}x and dv/dx = cos x ⇒ dx/dv = 1/cos x.

So the derivative of tan x with respect to sin x is

d/d(sin x) (tan x) =du/dv

=du/dx · dx/ dv

= sec^{2}x · 1/cos x = sec^{2}x · sec x = sec^{3} x.

Answer: the derivative of tan x with respect to sin x is sec^{3}x.

**Question 3:** Find the derivative of tan x with respect to cot x.

**Solution:**

Let u=tan x and v=cot x. Here we will find du/dv.

We have du/dx = sec^{2}x and dv/dx = -cosec^{2} x ⇒ dx/dv = -sin^{2}x.

So the derivative of tan x with respect to cot x is

d/d(cot x) (tan x) =du/dv

=du/dx · dx/dv

= sec^{2}x · (- sin^{2} x) = – (sin^{2} x)/(cos^{2} x) = -tan^{2}x.

Answer: the derivative of tan x with respect to cot x is -tan^{2}x.

**Question 4:** What is the derivative of x tan x?

**Solution:**

By the chain rule of derivatives, we have

d/dx(x tan x) = x d/dx(tan x) + tan x d/dx(x)

= x sec^{2}x + tan x · 1

= x sec^{2}x + tan x

Answer: The derivative of x tan x is x sec^{2}x + tan x.

**FAQs on Derivative of tan x**

**Q1: What is the derivative of tan x?**

Answer: The derivative of tan x is sec^{2}x.

**Q2: What is the derivative of tan**

^{2}x?Ans: Note that tan^{2}x = (tan x)^{2}. So by the power rule and the chain rule of derivatives, the derivative of tan^{2}x is equal to d/dx(tan^{2}x) = 2 tan x · d/dx(tan x) = 2 tan x sec^{2}x.

**Q3: Find the derivative of tan x in terms of cos x.**

Ans: We know that the derivative of tan x is sec^{2}x. As sec x=1/cos x, the derivative of tan x in terms of cos x is 1/cos^{2}x.

**Q4: What is the integration of tan x?**

Ans: The integration of tan x is -ln|cos x| + C (or) ln|sec x| + C.

**Q5: What is the derivative of tan**

^{-1}x?Ans: The derivative of tan^{-1}x is 1/(1+x^{2}).