TITLE: Fast way to show that $\int_{0}^{1}x(1-x) \sin (n\pi x)dx = \frac{4}{(n\pi)^3}$, $n$ odd
QUESTION [5 upvotes]: I can compute and show that for odd values of $n$, $$\int_{0}^{1}x(1-x) \sin (n\pi x)dx = \frac{4}{(n\pi)^3}$$ fairly easily by expanding the quadratic, splitting the integrand and then evaluating each component using integration by parts. However, this is rather tedious.
I was wondering if you could see a way of proving this identity without having to go through so much brute-force computations. The result is relatively neat so I suspect there may be a much easier way of computing the integral.
The integral looks perfect for $$\int_{0}^{a}f(x)dx=\int_{0}^{a}f(a-x)dx$$ but I was unable to find a solution using that because I could not somehow find a way to work with $\sin (n\pi(1-x))$
So what I have so far is
$$I=\int_{0}^{1}x(1-x) \sin (n\pi x)dx=\int_{0}^{1}x(1-x) \sin (n\pi(1-x))dx$$
But I am now stuck.

REPLY [2 votes]: Let $s(x)$ be the sawtooth wave, i.e. the $2\pi$-periodic function that over $(-\pi,\pi)$ equals $x$.
It is well-known that its Fourier series is given by:
$$ s(x) = 2\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}\,\sin(nx), $$
hence by termwise integration and evaluation at $x=0$ it follows that:
$$ p(x) = 2\sum_{n\geq 1}\frac{(-1)^n}{n^2}\,\cos(nx),$$
where $p(x)$ is the "parabolic wave", i.e. the $2\pi$-periodic function that equals $\frac{x^2}{2}-\frac{\pi^2}{6}$ over $(-\pi,\pi)$.
If $g(x)$ is a $2\pi$-periodic function that equals $\left(1+\frac{x}{\pi}\right)\left(1-\frac{x}{\pi}\right)$ over $(-\pi,\pi)$, it follows that:
$$ g(x) = \frac{2}{3}-\frac{4}{\pi^2}\sum_{n\geq 1}\frac{(-1)^n}{n^2}\,\cos(nx) $$
hence:
$$ h(x) = \frac{2}{3}-\frac{4}{\pi^2}\sum_{n\geq 1}\frac{1}{n^2}\,\cos(nx)$$
is the Fourier series of the $2\pi$-periodic function that equals $\frac{x}{\pi}\left(2-\frac{x}{\pi}\right)$ over $(0,2\pi)$, so:

$$ f(x) = \frac{1}{6}-\frac{1}{\pi^2}\sum_{n\geq 1}\frac{\cos(2\pi n x)}{n^2} $$
  is the Fourier series of the $1$-periodic function that equals $x(1-x)$ over $(0,1)$.

That leads to a not-so-short but quite simple alternative solution.