The Derivative of Tangent is one of the first transcendental functions introduced in Differential Calculus (*or Calculus I*). **The derivative of the tangent function is equal to secant squared, sec ^{2}(x).** We can prove this derivative using limits and trigonometric identities.

In this article, we will discuss how to derive the trigonometric function tangent. We will cover brief fundamentals, its formula, a graph comparison of tangent and its derivative, a proof, methods to derive, and a few examples.

##### CALCULUS

**Relevant for**…

Learning about the proof and the graphs of the derivative of tangent.

##### CALCULUS

**Relevant for**…

Learning about the proof and the graphs of the derivative of tangent.

## Proof of the Derivative of the Tangent Function using limits

The trigonometric function *tangent* of an angle is defined as the ratio of the opposite side to the adjacent side of an angle in a right triangle. Illustrating it through a figure, we have

where *C* is 90°. Therefore, getting the tangent of angle *A* can be evaluated as

$latex \tan{(A)} = \frac{a}{b}$

Before learning the proof of the derivative of the tangent function, you are hereby recommended to learn the Pythagorean theorem, Soh-Cah-Toa & Cho-Sha-Cao, and the first principle of limits as prerequisites.

To review, any function can be derived by equating it to the limit of

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

Suppose we are asked to get the derivative of

$latex f(x) = \tan{(x)}$

we have

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \tan{(x+h)} – \tan{(x)} }{h}}$$

With this equation, it is still not possible to express the limit due to the denominator *h* where if *zero* is substituted, will be undefined. Therefore, we can check if applying some trigonometric identities can be useful.

Analyzing our equation, we can observe that both the first and second terms in the numerator of the limit is a tangent of a sum of two angles *x* and *h* and a tangent of angle *x*. With this observation, we can try to apply the *defining relation identities for tangent, sine, and cosine*. Applying this, we have

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \frac{\sin{(x+h)}}{\cos{(x+h)}} – \frac{\sin{(x)}}{\cos{(x)}} }{h}}$$

Algebraically re-arranging by applying some rules of fraction, we have

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \frac{\sin{(x+h)}\cos{(x)} – \cos{(x+h)}\sin{(x)}}{\cos{(x+h)}\cos{(x)}} }{h}}$$

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \sin{(x+h)}\cos{(x)} – \cos{(x+h)}\sin{(x)} }{h\cos{(x+h)}\cos{(x)}}}$$

Looking at the re-arranged numerator, we can try to apply the *sum and difference identities for sine and cosine*, also called *Ptolemy’s identities*.

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

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\frac{ \sin{(h)} }{h\cos{(x+h)}\cos{(x)}}}$$

Re-arranging by applying the limit of product of two functions, we have

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left( \frac{ \sin{(h)} }{h} \cdot \frac{1}{\cos{(x+h)}\cos{(x)}} \right)}$$

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left( \frac{ \sin{(h)} }{h} \right)} \cdot \lim \limits_{h \to 0} {\left(\frac{1}{\cos{(x+h)}\cos{(x)}} \right)}$$

In accordance with the limits of trigonometric functions, the limit of trigonometric function $latex \sin{(\theta)}$ to $latex \theta$ as $latex \theta$ approaches zero is equal to one. The same can be applied to $latex \sin{(h)}$ over $latex h$. Applying, we have

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {1} \cdot \lim \limits_{h \to 0} {\left(\frac{1}{\cos{(x+h)}\cos{(x)}} \right)}$$

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left(\frac{1}{\cos{(x+h)}\cos{(x)}} \right)}$$

Finally, we have successfully made it possible to evaluate the limit of whatever is left in the equation. Evaluating by substituting the approaching value of $latex h$, we have

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left(\frac{1}{\cos{(x+h)}\cos{(x)}} \right)}$$

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left(\frac{1}{\cos{(x+(0))}\cos{(x)}} \right)}$$

$$\frac{d}{dx} f(x) = \lim \limits_{h \to 0} {\left(\frac{1}{\cos{(x)}\cos{(x)}} \right)}$$

$latex \frac{d}{dx} f(x) = \frac{1}{\cos{(x)}\cos{(x)}}$$

We know that by the *defining relation identities*, the reciprocal of the trigonometric function cosine is secant. Applying, we have

$$\frac{d}{dx} f(x) = \frac{1}{\cos{(x)}} \cdot \frac{1}{\cos{(x)}}$$

$$\frac{d}{dx} f(x) = \sec{(x)} \cdot \sec{(x)}$$

$$\frac{d}{dx} f(x) = \sec^{2}{(x)}$$

Therefore, the derivative of the trigonometric function ‘*tangent*‘ is:

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

## Graph of Tangent of *x* VS. The Derivative of Tangent of *x*

Given the function

$latex f(x) = \tan{(x)}$

the graph is illustrated as

And as we know by now, by deriving $latex f(x) = \tan{(x)}$, we get

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

which is illustrated graphically as

Illustrating both graphs in one, we have

Analyzing the differences of these functions through these graphs, you can observe that the original function $latex f(x) = \tan{(x)}$ has a domain of

$latex \left(-\frac{3\pi}{2},-\frac{\pi}{2}\right) \cup \left(-\frac{\pi}{2},\frac{\pi}{2}\right) \cup \left(\frac{\pi}{2},\frac{3\pi}{2}\right)$

*within the finite intervals of*

$latex \left(-\frac{3\pi}{2},\frac{3\pi}{2}\right)$

and exists within the range of

$latex (-\infty,\infty)$ or *all real numbers*

whereas the derivative $latex f'(x) = \sec^{2}{(x)}$ has a domain of

$latex \left(-\frac{3\pi}{2},-\frac{\pi}{2}\right) \cup \left(-\frac{\pi}{2},\frac{\pi}{2}\right) \cup \left(\frac{\pi}{2},\frac{3\pi}{2}\right)$

*within the finite intervals of*

$latex \left(-\frac{3\pi}{2},\frac{3\pi}{2}\right)$

and exists within the range of

$latex [1,\infty)$ or $latex y \geq 1$

## Examples of derivatives of composite tangent functions

Here are some examples of using the chain rule to derive a compound tangent function.

### EXAMPLE 1

**Derive:** $latex f(x) = \tan(5x)$

##### Solution

Analyzing the given tangent function, we see that it is a tangent of the function $latex 5x$. Then, we have to use the chain rule.

We can consider $latex u=5x$ as the inner function. Then, we have $latex f(u)=\tan(u)$ and using the chain rule, we have:

$$\frac{dy}{dx}=\frac{dy}{du} \frac{du}{dx}$$

$$\frac{dy}{dx}=\sec^2(u) \times 5$$

Substituting $latex u=5x$ back into the function, we have:

$$\frac{dy}{dx}=5\sec^2(5x)$$

### EXAMPLE 2

**Derive:** $latex F(x) = \tan{\left(3x^2+6 \right)}$

##### Solution

The chain rule has to be used to derive this function.

We express the tangent function as $latex f (u) = \tan(u)$, where $latex u = 3x^2+6$.

Now, we obtain the derivative of the exterior function $latex f(u)$, which must use the derivative of the tangent function, in terms of $latex u$.

$$\frac{d}{du} ( \tan{(u)} ) = \sec^{2}(u)$$

Then, we obtain the derivative of the inner function $latex g(x)$ or $latex u$:

$$\frac{d}{dx}(g(x)) = \frac{d}{dx}(3x^2+6)$$

$$\frac{d}{dx}(g(x)) = 6x$$

Apply the basic formula of the chain rule by algebraically multiplying the derivative of the outer function $latex f(u)$ by the derivative of the inner function $latex g(x)$.

$$\frac{dy}{dx} = \frac{d}{du} (f(u)) \cdot \frac{d}{dx} (g(x))$$

$$\frac{dy}{dx} = \sec^{2}{(u)} \cdot 6x$$

Finally, substitute $latex u$ into $latex f'(u)$ and simplify:

$$\frac{dy}{dx} = \sec^{2}{(3x^2+6)} \cdot 6x$$

$$\frac{dy}{dx} = 6x\sec^{2}{(3x^2+6)}$$

$latex F'(x) = 6x\sec^{2}{(3(x^2+2))}$

### EXAMPLE 3

Find the derivative of $latex f(x) = \tan(\sqrt{x})$.

##### Solution

In this case, we have the square root function as the inner function of the tangent. We can consider $latex u=\sqrt{x}$ as the inner function.

In addition, if we write $latex u=\sqrt{x}$ as $latex u=x^{\frac{1}{2}}$, the derivative $latex \frac{du}{dx}$ is:

$$\frac{du}{dx}=\frac{1}{2}x^{-\frac{1}{2}}$$

Writing $latex f(u)=\tan(u)$ and using the chain rule, we have:

$$\frac{dy}{dx}=\frac{dy}{du} \frac{du}{dx}$$

$$\frac{dy}{dx}=\sec^2(u) \times \frac{1}{2}x^{-\frac{1}{2}}$$

Using $latex u=\sqrt{x}$ and simplifying, we have:

$$\frac{dy}{dx}=\sec^2(\sqrt{x}) \times \frac{1}{2}x^{-\frac{1}{2}}$$

$$\frac{dy}{dx}=\frac{1}{2\sqrt{x}}\sec^2(\sqrt{x})$$

## Practice of derivatives of compound tangent functions

## See also

Interested in learning more about the derivatives of trigonometric functions? Take a look at these pages:

### Learn mathematics with our additional resources in different topics

**LEARN MORE**