Integration of $x^2 \sin(x)$ by parts
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.
$u=x^2$ then $du=2xdx$ and $dv=\sin(x)dx$ then $v=-\cos(x)$. So integral becomes $=-(x^2\cos(x))+2\int x\cos(x)dx$ integration by parts for $$\int x\cos(x)dx$$ $x=u, dx=du$ and $dv=\cos(x)dx, v=\sin(x)$ then $$=-(x^2\cos(x))-2\int \sin(x)dx+2x\sin(x)$$ the integral of $\sin x$ is $-\cos x$ so we get $$=2\cos(x)-x^2\cos(x)+2x\sin(x)$$