# If f(x)= cot5 x  and g(x) = sqrt(-x+3 , how do you differentiate f(g(x))  using the chain rule?

Mar 16, 2017

$\frac{\mathrm{df}}{\mathrm{dx}} = - \frac{{\csc}^{2} \left(\sqrt{- x + 3}\right)}{2 \sqrt{- x + 3}}$

#### Explanation:

As $f \left(x\right) = \cot 5 x$ and $g \left(x\right) = \sqrt{- x + 3}$, therefore

$f \left(g \left(x\right)\right) = \cot \left(5 \sqrt{- x + 3}\right)$

According to chain rule when $f = f \left(g \left(x\right)\right)$,

$\frac{\mathrm{df}}{\mathrm{dx}} = \frac{\mathrm{df}}{\mathrm{dg}} \times \frac{\mathrm{dg}}{\mathrm{dx}}$

As $f = \cot \left(g \left(x\right)\right)$,

(df)/(dg)=-csc^2(g(x)=-csc^2(sqrt(-x+3))

and as $g \left(x\right) = \sqrt{- x + 3}$

$\frac{\mathrm{dg}}{\mathrm{dx}} = \frac{1}{2 \sqrt{- x + 3}} \times \frac{d}{\mathrm{dx}} \left(- x + 3\right) = - \frac{1}{2 \sqrt{- x + 3}}$

(note that we have again applied chain rule here as $- x + 3$ is again a function of $x$ and hence we should multiply by $\frac{d}{\mathrm{dx}} \left(- x + 3\right)$)

Hence $\frac{\mathrm{df}}{\mathrm{dx}} = - {\csc}^{2} \left(\sqrt{- x + 3}\right) \times - \frac{1}{2 \sqrt{- x + 3}}$

= $- \frac{{\csc}^{2} \left(\sqrt{- x + 3}\right)}{2 \sqrt{- x + 3}}$