Compute $\int_{-\pi}^\pi{x^2\sin\frac{x}{2}dx}$ I have to solve this integral:
$$\int_{-\pi}^\pi{x^2\sin\frac{x}{2}\mathrm dx}$$
I'm thinking about integration by parts, but I'm not sure how to either derivate or integrate the $\sin\frac{x}{2}$ part. These are solutions to that part:
$$\int{\sin\frac{x}{2}\mathrm dx} = -2\cos\frac{x}{2} + C$$
$$\frac{\mathrm d}{\mathrm dx}\left(\sin\frac{x}{2}\right)=\frac12\cos\frac{x}{2}$$
How do I get to these solutions? By introducing a new variable? Or are these one of those "well known" ones that I can simply memorise?
 A: Hint:
$$\int_{-a}^a f(x)\mathrm d x=0 \qquad \text{ where } f \,\text{ is an odd function}$$
A: By parts is a great way to go with the extra information
$$
\int \sin (\alpha x) dx = \frac{1}{\alpha}\int \sin(u)du
$$
Where the later expression you should know :).
A more complicated (but simpler further along your mathematical journey) is 
$$
\frac{d}{d\alpha^2}\sin(\alpha x) = -x^2\sin(\alpha x)
$$
Thus you can have an integral 
$$
-\frac{d}{d\alpha^2}\int_{-\pi}^{\pi}\sin(\alpha x)dx
$$ 
This should be easier to compute.
A: $\int{\sin\frac{x}{2}\mathrm dx}$
$u = \frac{x}{2}$ therefore $du = \frac{1}{2} dx$ and $dx = 2 du$
Therefore;
$\int{2\sin{u}\ du}$
A: $$\int_{-\pi}^\pi{x^2\sin\frac{x}{2}\mathrm dx}$$
Using integration by part for $\int{x^2\sin\frac{x}{2}\mathrm dx}$
$$\int{udv}=uv-\int{vdu}$$
Where $u=x^2$ and $dv=\sin{\frac{x}{2}}$
$$\int{x^2\sin\frac{x}{2}\mathrm dx}=-2x^2\cos{\frac{x}{2}}+4\int{x\cos\frac{x}{2}\mathrm dx}$$
Using the formula again:
$$\int{x^2\sin\frac{x}{2}\mathrm dx}=-2x^2\cos{\frac{x}{2}}+8x\sin{\frac{x}{2}}-8\int{\sin\frac{x}{2}\mathrm dx}$$
