Integration of $x^2 \sin(x)$ by parts How would I integrate the following?
$$\int_0^{\pi/2} x^2\sin(x)\,dx$$
I did $u=x^2$ and $dv=\sin(x)$
I got
$x^2-\cos(x)+2\int x\cos(x)\,dx.\quad$ I then used $u=x$ and $dv=\cos(x).$
I got 
$$x^2-\cos(x)+2[x-\sin(x)-\int\sin(x)]$$
then
$x^2-\cos(x)+-2 \sin(x)(x)-\cos(x)\Big|_0^{\pi/2} =\dfrac{\pi^2}{4}-0-2$

You need to multiply $u$ and $v$, then subtract the subsequent integral:
So you should have $$\begin{align} \int_0^{\pi/2} x^2\sin(x)\,dx & = -x^2\cos(x)+2\int x\cos(x)\,dx \\ \\ 
& = -x^2 \cos x + 2\Big[x \sin x - \int \sin x\,dx\Big]\\ \\
& = -x^2\cos x + 2x \sin x - (-2\cos x)\\ \\
& = -x^2 \cos x + 2x \sin x + 2\cos x \Big|_0^{2\pi}\end{align}$$
And proceed from there.
