# If f(x) = ln|secx + tanx|, what is f'(x)?

Feb 19, 2017

$\frac{d}{\mathrm{dx}} \ln | \sec x + \tan x | = \sec x$

#### Explanation:

Start by rewriting $\sec x$ and $\tan x$ in terms of sine and cosine. Call $\ln | \sec x + \tan x | ,$f(x)#.

$f \left(x\right) = \ln | \sec x + \tan x |$

$f \left(x\right) = \ln | \frac{1}{\cos} x + \sin \frac{x}{\cos} x |$

$f \left(x\right) = \ln | \frac{1 + \sin x}{\cos} x |$

Now use the rule $\ln \left(\frac{a}{b}\right) = \ln a - \ln b$ to simplify further.

$f \left(x\right) = \ln \left(1 + \sin x\right) - \ln \left(\cos x\right)$

You can differentiate this using the chain rule on each term. I'll show you how to do one. Let $y = \ln u$ and $u = 1 + \sin x$. Then $\frac{\mathrm{dy}}{\mathrm{du}} = \frac{1}{u}$ and $\frac{\mathrm{du}}{\mathrm{dx}} = \cos x$. If $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\mathrm{dy}}{\mathrm{du}} \cdot \frac{\mathrm{du}}{\mathrm{dx}}$, then $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{1}{u} \cdot \cos x = \cos \frac{x}{1 + \sin x}$.

$f ' \left(x\right) = \cos \frac{x}{1 + \sin x} - \left(- \sin \frac{x}{\cos} x\right)$

$f ' \left(x\right) = \cos \frac{x}{1 + \sin x} + \sin \frac{x}{\cos} x$

This can be simplified.

$f ' \left(x\right) = \frac{\cos x \left(\cos x\right)}{\cos x \left(1 + \sin x\right)} + \frac{\sin x \left(1 + \sin x\right)}{\cos x \left(1 + \sin x\right)}$

$f ' \left(x\right) = \frac{{\cos}^{2} x + \sin x + {\sin}^{2} x}{\cos x \left(1 + \sin x\right)}$

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

$f ' \left(x\right) = \frac{1 + \sin x}{\cos x \left(1 + \sin x\right)}$

$f ' \left(x\right) = \frac{1}{\cos} x$

Apply $\sec x = \frac{1}{\cos} x$.

$f ' \left(x\right) = \sec x$

Hopefully this helps!