# How do you differentiate f(x)=x/(x^2(1-sinx+cosx)) using the quotient rule?

Nov 25, 2016

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

#### Explanation:

First of all, we can simplify the function as follows:

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

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

Method 1: Through the quotient rule

Let $f \left(x\right) = g \frac{x}{h \left(x\right)}$. Then $g \left(x\right) = 1$ and $h \left(x\right) = x - x \sin x + x \cos x$

$g ' \left(x\right) = 0$ and $h ' \left(x\right) = 1 - \left(\sin x + x \cos x\right) + \left(\cos x - x \sin x\right) = 1 - \sin x - x \cos x + \cos x - x \sin x$

By the quotient rule:

color(red)(f'(x) = (g'(x) xx h(x) - h'(x) xx g(x))/(h(x))^2

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

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

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

Method 2: By the chain rule

We can write $f \left(x\right) = \frac{1}{x - x \sin x + x \cos x}$ as $f \left(x\right) = {\left(x - x \sin x + x \cos x\right)}^{-} 1$.

We let $y = {u}^{-} 1$ and $u = x - x \sin x + x \cos x$.

$\frac{\mathrm{dy}}{\mathrm{du}} = - \frac{1}{{u}^{2}}$ and $\frac{\mathrm{du}}{\mathrm{dx}} = 1 - \sin x - x \cos x + \cos x - x \sin x$ (see above).

The chain rule states:

color(red)(dy/dx = dy/(du) xx (du)/dx

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

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\sin x + x \cos x - 1 + x \sin x - \cos x}{x - x \sin x + x \cos x} ^ 2$