Calculating the Fourier series of $x^{3}$ I was given as homework to calculate the Fourier series of $x^{3}$.
I know, in general, how to obtain the coefficients of the series using
integration with $$\sin(nx),\cos(nx)$$ multiplied by the given function.
Is there an easier way to calculate this Fourier series other then
calculating $$\int x^{3}\cos(nx),\int x^{3}\sin(nx)\;?$$ 
I guess that both of the above can be calculated by using integration
by parts $2-3$ times, but maybe there is a smarter way (maybe even
one that allows me to calculate the Fourier series of $x^{n}$ , $n\geq1$). 
I would appreciate to hear any thoughts and techniques for solving
this problem
 A: If you are expanding the Fourier series of $x^3$ over a symmetric interval, say $I=[-T,T]$, then notice how $x^3$ is an odd function over $I$, while $\cos(nx)$ is an even function over $I$, hence the integral $\int_{-T}^T x^3 \cos(nx) dx=0$, all vanishes. Now you just need to compute the Fourier coefficients for $\sin(nx)$. To which several application of integration by parts, as you mentioned, will do. 
In general, try to exploit the symmetry of the integration whenever possible (though not always possible). Perseverance, neatness, and a supply paper will be of great aid.
A: You can simplify things a bit by differentiating under the integral.  This is a little tricky because you can't just set up an integral like
$$\int_{-\pi}^{\pi} dx \: \sin{a x}$$
as this is obviously zero.  Rather, consider
$$\int_0^{\pi} dx \: \sin{a x} = \frac{1-\cos{a \pi}}{a}$$
The the coefficient you seek is
$$2 \frac{\partial^3}{\partial a^3} \frac{1-\cos{a \pi}}{a}$$
evaluated at $a=n $.  While this does require a little bookkeeping, it is easier than integrating by parts 3 times.  This is justified because the product of an odd power of $x$ and the sine is an even function over the symmetric interval.  
The result of differentiating is

$$ -\frac{12 (1-\cos (\pi  a))}{a^4}+\frac{12 \pi  \sin (\pi  a)}{a^3}-\frac{6 \pi ^2 \cos (\pi  a)}{a^2}-\frac{2\pi ^3 \sin (\pi  a)}{a}$$

A: You need to know your interval because you will need to multiply those integrals by some value according to it. If your interval is $[0,L]$, then the cosinus integral vanishes. And in this case you will calculate only:
$$a_n=\frac{2}{L}\int\limits_{0}^{L}x^3\sin(n\frac{\pi}{L}x)dx$$
Which you can find the solution here.
If your interval is $[-L,L]$ then you would have to calculate:
$$a_n=\frac{1}{L}\int\limits_{-L}^{L}x^3\sin(n\frac{\pi}{L}x)dx$$
Whatever is the case your solution will be:
$$\sum_{n=1}^{+\infty}a_n\sin(n\frac{\pi}{L}x)$$
There is no shortcut.
