# How do you differentiate f(x)= tanx twice using the quotient rule?

Dec 23, 2015

$\frac{\mathrm{dy}}{\mathrm{dx}} = {\sec}^{2} x$

$\frac{{d}^{2} y}{\mathrm{dx}} ^ 2 = 2 {\sec}^{2} x \tan x$

#### Explanation:

In order to start properly, let's just remember that $\tan x = \frac{\sin x}{\cos x}$ and now differentiate this quotient using the proper rule.

The quotient rule states that for a function $y = f \frac{x}{g} \left(x\right)$, $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{f ' \left(x\right) g \left(x\right) - f \left(x\right) g ' \left(x\right)}{g} {\left(x\right)}^{2}$

$f \left(x\right) = \sin x$
$g \left(x\right) = \cos x$
$f ' \left(x\right) = \cos x$
$g ' \left(x\right) = - \sin x$

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\cos x \cos x - \sin x \left(- \sin x\right)}{\cos x} ^ 2 = \frac{{\cos}^{2} x + {\sin}^{2} x}{\cos} ^ 2 x$

From trigonometric identities, we know that ${\sin}^{2} x + {\cos}^{2} x = 1$

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{1}{{\cos}^{2} x} = {\sec}^{2} x$

To find the second derivative, use the chain rule, which states that for a function $y = f \left(g \left(x\right)\right)$, $\frac{\mathrm{dy}}{\mathrm{dx}} = f ' \left(g \left(x\right)\right) g ' \left(x\right)$.

First, rewrite $\frac{\mathrm{dy}}{\mathrm{dx}} = {\cos}^{-} 2 x$

Then, according to the chain rule:

$\frac{{d}^{2} y}{\mathrm{dx}} ^ 2 = - 2 {\cos}^{-} 3 x \frac{d}{\mathrm{dx}} \left(\cos x\right)$

$\implies \frac{- 2 \left(- \sin x\right)}{\cos} ^ 3 x$

$\frac{{d}^{2} y}{\mathrm{dx}} ^ 2 = \frac{2 \sin x}{\cos} ^ 3 x$ $\text{or}$ $\frac{{d}^{2} y}{\mathrm{dx}} ^ 2 = 2 {\sec}^{2} x \tan x$