TITLE: Finding a function from a fourier series
QUESTION [10 upvotes]: Taken from Apostol Analysis, it says, find a continuous function that generates the fourier series:
$$ \sum_{n} \frac{-1^n}{n^3} \sin(nx) $$
I really have no idea how to solve this, instinctively I tried solving $\langle f,\sin(nx)\rangle =  \frac{-1^n}{n^3}$ and $\langle f,\cos(nx)\rangle =  0$ and got nowhere, any help would be much appreciated.

REPLY [5 votes]: Observations: 

$f$ is odd
$f$ is continuous on $\mathbb R$, because the series converges uniformly. Together with 1, this implies $f(\pi)=0$.
$f$ is a cubic polynomial on $(-\pi,\pi)$, because the Fourier coefficients of $x^k$ involve $1/n^k$ (integration by parts happens $k$ times). 

Odd cubic polynomials vanishing at $\pi$ are of the form $A(x^3-\pi^2 x)$. There are various ways to find $A$, including boring integration. A less boring way is to   observe that
$$ f'(x)= \sum_{n=1}^\infty \frac{(-1)^{n}}{n^2}\cos nx$$ 
is continuous on $\mathbb R$ and 
$$f'(\pi)=  \sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi ^2}{6}$$
Since $A(x^3-\pi^2 x)'=A(3x^2-\pi^2)$ evaluates to $2\pi^2A$ at $x=\pi$, we have $A=1/12$.