# What is the arc length of f(x)=xsinx-cos^2x  on x in [0,pi]?

The arc length $s$ of a function $f \left(x\right)$ on $x \in \left[a , b\right]$ is given by
$s = {\int}_{a}^{b} \sqrt{1 + {\left(f ' \left(x\right)\right)}^{2}} \mathrm{dx}$
Here, $f \left(x\right) = x \sin x - {\cos}^{2} x$ so $f ' \left(x\right) = \sin x + x \cos x + 2 \cos x \sin x$.
$s = {\int}_{0}^{\pi} \sqrt{1 + {\left(\sin x + x \cos x + 2 \cos x \sin x\right)}^{2}} \mathrm{dx} \approx 6.4705$