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

Oct 21, 2016

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

#### Explanation:

Here you take the derivative of the outside, cos, and then the expression within the parenthesis.

$u = \sqrt{\frac{1}{x} ^ 2} - x = {\left({x}^{-} 2\right)}^{\frac{1}{2}} - x = {x}^{- \frac{2}{2}} - x = {x}^{-} 1 - x = \frac{1}{x} - x$

$u ' = - 1 {x}^{-} 2 - 1 = - {x}^{-} 2 - 1 = - \frac{1}{x} ^ 2 - 1$

$g \left(u\right) = - \cos \left(u\right)$

$g ' \left(u\right) = - \left(- \sin \left(u\right)\right) = \sin \left(u\right)$

Chain rule

$g ' \left(u\right) \cdot u '$

Substitute

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