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

Jul 1, 2017

See below

It's ugly

#### Explanation:

The quotient rule states that if $f \left(x\right) = \frac{g \left(x\right)}{h \left(x\right)}$ then $f ' \left(x\right) = \frac{g ' \left(x\right) h \left(x\right) - g \left(x\right) h ' \left(x\right)}{{h}^{2} \left(x\right)}$. In this case, $g \left(x\right) = x - \sin x$ and $h \left(x\right) = {x}^{2} \cos x$.

To find $g ' \left(x\right)$ we need to use the difference rule, which states that if $g \left(x\right) = u \left(x\right) - v \left(x\right)$ then $g ' \left(x\right) = u ' \left(x\right) - v ' \left(x\right)$. Here, $u \left(x\right) = x$ and $v \left(x\right) = \sin x$, so $u ' \left(x\right) = \frac{d}{\mathrm{dx}} x = 1$ and $v ' \left(x\right) = \frac{d}{\mathrm{dx}} \sin x = \cos x$, therefore $g ' \left(x\right) = 1 - \cos x$.

To find $h ' \left(x\right)$ we need to use the product rule, which states that if $h \left(x\right) = u \left(x\right) v \left(x\right)$ then $h ' \left(x\right) = u ' \left(x\right) v \left(x\right) + u \left(x\right) v ' \left(x\right)$. Here, $u \left(x\right) = {x}^{2}$ and $v \left(x\right) = \cos x$, so $u ' \left(x\right) = \frac{d}{\mathrm{dx}} {x}^{2} = 2 x$ and $v ' \left(x\right) = \frac{d}{\mathrm{dx}} \cos x = \text{-} \sin x$, therefore $h ' \left(x\right) = 2 x \cos x - {x}^{2} \sin x$.

${h}^{2} \left(x\right) = {\left({x}^{2} \cos x\right)}^{2} = {x}^{4} {\cos}^{2} x$

Putting everything back together gives $f ' \left(x\right) = \frac{\left(1 - \cos x\right) \left({x}^{2} \cos x\right) - \left(x - \sin x\right) \left(2 x \cos x - {x}^{2} \sin x\right)}{{x}^{4} {\cos}^{2} x}$, which simplifies to $\frac{\left({x}^{2} \cos x - {x}^{2} {\cos}^{2} x\right) - \left(2 {x}^{2} \cos x - {x}^{3} \sin x - 2 x \sin x \cos x + {x}^{2} {\sin}^{2} x\right)}{{x}^{4} {\cos}^{2} x}$, which simplifies to $\frac{{x}^{2} \cos x - {x}^{2} {\cos}^{2} x - 2 {x}^{2} \cos x + {x}^{3} \sin x + 2 x \sin x \cos x - {x}^{2} {\sin}^{2} x}{{x}^{4} {\cos}^{2} x}$, which simplifies to $\frac{{x}^{3} \sin x - {x}^{2} \cos x - {x}^{2} {\sin}^{2} x - {x}^{2} {\cos}^{2} x + 2 x \sin x \cos x}{{x}^{4} {\cos}^{2} x}$, which factors to $\frac{x \left({x}^{2} \sin x - x \cos x - x \left({\sin}^{2} x + {\cos}^{2} x\right) + 2 \sin x \cos x\right)}{{x}^{4} {\cos}^{2} x}$.

Since $\sin 2 \theta = 2 \sin \theta \cos \theta$ and ${\sin}^{2} \theta + {\cos}^{2} \theta = 1$, this simplifies to $\frac{{x}^{2} \sin x - x \cos x - x + \sin 2 x}{{x}^{3} {\cos}^{2} x}$