I am interested in the properties of Fourier series under integration and differentiation, and I've noticed a "strange" phenomenon. Suppose I have a Fourier series which I Integrate, and suppose that I can integrate it term by term.
$$f(x)=a_0+\sum_{n=1}^\infty a_n \cos(nx)+\sum_{n=1}^\infty b_n \sin(nx)$$
$$\int f(x)dx=C+a_0 x+\sum_{n=1}^\infty \frac{a_n}{n} \sin(nx)-\sum_{n=1}^\infty \frac{b_n}{n} \cos(nx) $$
Now because I want the integral to be represented as a Fourier series as well, I use the Fourier series for $x$:
$$x=\sum_{n=1}^\infty \frac{2}{\pi}\frac{(-1)^{n+1}}{n}\sin(nx)$$
So I have:
$$\int f(x)dx=C+\sum_{n=1}^\infty \left(\frac{2a_0}{\pi}\frac{(-1)^{n+1}}{n}+\frac{a_n}{n}\right)\sin(nx)+\sum_{n=1}^\infty \frac{b_n}{n}\cos(nx)$$
My problem is that upon differentiation (term by term), this series does not appear to give back the original Fourier series, as the constant term has been shifted into the cosine terms.
I think my mistake is the step I take converting the $x$ to a Fourier series, because it can't then be differentiated term by term (see this question). Am I correct? And does this mean the integral of a Fourier series cannot be another Fourier series?
Fourier series (as with infinite series in general) cannot always be term-by-term differentiated. For general series we have the following theorem
Your example fails this theorem dramatically as the derivative of the Fourier series of $x$ do not converge anywhere.
We also have some more specific results. The following theorem gives conditions for which this can be done for Fourier series:
The last condition is not satisfied when the Fourier series has a jump-discontinuity as $x=L$ so we in general we don't expect to be able to term-by-term differentiate a Fourier series that has a jump-discontinuity (thought the theorem does not rule it out). For your example of the Fourier series of $f(x) = x$ the first condition are satisfyed as $f$ is both smooth and continuous on $[-1,1]$ however $f(-1) \not= f(1)$ so the theorem does not apply.
For integration of Fourier series we have the following theorem
Note that the resulting series does not have to be a Fourier series. For example if we have a Fourier series $f(x) = a_0 + \ldots$ with $a_0\not= 0$ then $\int f(x){\rm d}x = a_0x+ \ldots$ and the presence of the $a_0x$ term makes this not be a Fourier series (though for this example one can probably expand $x$ in a Fourier series to get such a series).
The proofs of the theorems above can be found in any good textbook on Fourier series. You can also find them in the following course notes (by P. Laval).