After constructing an even extension, and evaluating over $-\pi \le x \le \pi$ $\frac \pi2a_n=\int_0^\pi x^3\cos nx\ dx $
Now I've tried to solve this, I wish I had the skills and the patience to mathjax-ify my steps here but it'll be too much to do. I'll write my result after evaluating the integral at least:
$a_n = \frac{2(3(\pi^2n^2-2)\cos(\pi n) +6)}{\pi n^4}$
Now I tried to use the fact that $\cos n\pi$ follows a pattern, but I still couldn't get it to match the answer I'm expected to derive (which is again, beyond my mathjax skills). It's a cosine series where $ 0\le x \le \pi$. I'm way off, not even close.
So yeah, basically I'm asking for some tips on how to proceed from here. If possible, a full solution would be brilliant so that I can once and for all understand such problems.
EDIT: Here's the answer I'm supposed to get: