# If f(x)=sinx-xcosx, how the function behaves in the intervals (0,pi) and (pi,2pi) i.e. whether it is increasing or decreasing?

Jun 29, 2016

Between $\left(0 , \pi\right)$, $f \left(x\right)$ is increasing and
between $\left(\pi , 2 \pi\right)$, $f \left(x\right)$ is decreasing.

#### Explanation:

Whether a function $f \left(x\right)$ is increasing or decreasing depends on whether $f ' \left(x\right) = \frac{\mathrm{df}}{\mathrm{dx}}$ is positive or negative.

As $f \left(x\right) = \sin x - x \cos x$

$f ' \left(x\right) = \frac{\mathrm{df}}{\mathrm{dx}} = \cos x - \left(1 \times \cos x + x \times \left(- \sin x\right)\right)$

= $\cos x - \cos x + x \sin x = x \sin x$

Now between $\left(\pi , 2 \pi\right)$, $\sin x$ is negative, but $x$ is positive, hence $f ' \left(x\right)$ is negative, and

between $\left(0 , \pi\right)$, $\sin x$ is positive and $x$ too is positive, hence $f ' \left(x\right)$ is positive.

Hence while between $\left(0 , \pi\right)$, $f \left(x\right)$ is increasing, between $\left(\pi , 2 \pi\right)$, $f \left(x\right)$ is decreasing.

graph{sinx-xcosx [-5.54, 14.46, -6.36, 3.64]}