# How do you differentiate f(x)=xsinx+cosx?

Mar 9, 2017

$f ' \left(x\right) = x \cos x$

#### Explanation:

$\textcolor{\mathmr{and} a n \ge}{\text{Reminder}}$

• d/dx(sinx)=cosx" and " d/dx(cosx)=-sinx

$\text{to differentiate "xsinx" use the "color(blue)"product rule}$

$\text{Given "f(x)=g(x)h(x)" then}$

$\textcolor{red}{\overline{\underline{| \textcolor{w h i t e}{\frac{2}{2}} \textcolor{b l a c k}{f ' \left(x\right) = g \left(x\right) h ' \left(x\right) + h \left(x\right) g ' \left(x\right)} \textcolor{w h i t e}{\frac{2}{2}} |}}} \leftarrow \text{ product rule}$

$\text{here } g \left(x\right) = x \Rightarrow g ' \left(x\right) = 1$

$\text{and } h \left(x\right) = \sin x \Rightarrow h ' \left(x\right) = \cos x$

$\Rightarrow f ' \left(x\right) = x \cos x + \sin x \leftarrow \text{ derivative of } x \sin x$

Differentiating the original f(x)

$f \left(x\right) = x \sin x + \cos x$

$\Rightarrow f ' \left(x\right) = x \cos x + \sin x - \sin x$

$\Rightarrow f ' \left(x\right) = x \cos x$