# How do you differentiate f(x) = 4/sqrt(tan^2(1-x)  using the chain rule?

Jan 5, 2016

See the explanation section below.

#### Explanation:

To avoid the quotient rule, let's rewrite $f$ as

$f \left(x\right) = 4 {\left({\tan}^{2} \left(1 - x\right)\right)}^{- \frac{1}{2}}$

Now use the power and chain rules:

$f ' \left(x\right) = 4 \left[\left(- \frac{1}{2}\right) {\left({\tan}^{2} \left(1 - x\right)\right)}^{- \frac{3}{2}}\right] \frac{d}{\mathrm{dx}} \left({\tan}^{2} \left(1 - x\right)\right)$

Finding $\frac{d}{\mathrm{dx}} \left({\tan}^{2} \left(1 - x\right)\right)$ will require the powe and chain rule applied to ${\left(\tan \left(1 - x\right)\right)}^{2}$. So we get,

$f ' \left(x\right) = 4 \left[\left(- \frac{1}{2}\right) {\left({\tan}^{2} \left(1 - x\right)\right)}^{- \frac{3}{2}}\right] \left[2 \left(\tan \left(1 - x\right)\right)\right] \frac{d}{\mathrm{dx}} \left(\tan \left(1 - x\right)\right)$

$= 4 \left[\left(- \frac{1}{2}\right) {\left({\tan}^{2} \left(1 - x\right)\right)}^{- \frac{3}{2}}\right] \left[2 \left(\tan \left(1 - x\right)\right)\right] \left[{\sec}^{2} \left(1 - x\right)\right] \frac{d}{\mathrm{dx}} \left(1 - x\right)$

$= 4 \left[\left(- \frac{1}{2}\right) {\left({\tan}^{2} \left(1 - x\right)\right)}^{- \frac{3}{2}}\right] \left[2 \left(\tan \left(1 - x\right)\right)\right] \left[{\sec}^{2} \left(1 - x\right)\right] \left[- 1\right]$

Simplifying algebraically, gets us,

$f ' \left(x\right) = 4 {\left(\tan \left(1 - x\right)\right)}^{- \frac{3}{2}} \tan \left(1 - x\right) {\sec}^{2} \left(1 - x\right)$

$= \frac{4 \tan \left(1 - x\right) {\sec}^{2} \left(1 - x\right)}{{\tan}^{2} \left(1 - x\right)} ^ \left(\frac{3}{2}\right)$

Avoiding Error

Remember that ${\left(\sqrt{u}\right)}^{2} = u$,

but if we square first, we get

$\sqrt{{u}^{2}} = \left\mid u \right\mid$

If you don't mind rewriting as a piecewise function, you could use:

$f \left(x\right) = \frac{4}{\left\mid \tan \left(1 - x\right) \right\mid} = 4 \left\mid \cot \right\mid \left(1 - x\right) = \left\{\begin{matrix}4 \cot \left(1 - x\right) & 1 - x > 0 \\ - 4 \cot \left(1 - x\right) & 1 - x < 0\end{matrix}\right.$

Now differentiate each piece to get a piecewise derivative.