# Where does this term come from? Fourier Series of $x+\sin(x)$

I'm starting to learn Fourier series and I've tried to find the Fourier series for $$f(x) =x+\sin(x), \quad\quad -\pi Since $$f$$ is odd, it has a Fourier series of the form $$\sum_{n = 1}^{+\infty}b_n \sin(nx)$$ For $$b_n$$ i got $$b_n= -\frac{2\cos(n\pi)}{n} = \frac{2(-1)^{n+1}}{n}$$So, the Series can be written as $$\sum_{n = 1}^{+\infty}\frac{2(-1)^{n+1}}{n} \sin(nx)$$

However, the solution that appears in the book (Linear Partial differential equations for scientists and engineers by Tyn Myint-U) is $$\sin(x)+\sum_{n = 1}^{+\infty}\frac{2(-1)^{n+1}}{n} \sin(nx)$$

There is a mistake in your computation of $$b_1$$. You should get $$b_1=3$$.

Compute $$\int_{-\pi} ^{\pi} (x+\sin x) \sin xdx=\int_{-\pi} ^{\pi} x \sin xdx+\int_{-\pi} ^{\pi} \sin ^{2}x dx$$ using integration by parts for the first term and the formula $$\sin ^{2}x=\frac 1 2 (1-\cos (2x))$$ for the second. You seem to have assumed that second term is $$0$$ but it is not.

For $$n>1$$ you computation is correct. Here $$\int \sin x \sin (nx)dx=0$$.

Your Fourier series just describes $$f(x)=x$$. The additional $$\sin(x)$$ is the Fourier series representing just that, the other term $$\sin(x)$$.

As the Fourier representation is linear, you can just add both.