# Calculate Fourier series and explicitly sum it for x=0

First off all, I am not sure what 'explicitly sum for $x=0$' means. I just figured I should find the infinite sum.

My function is

$f(x)=\theta(-x)\sin(x)+\theta(x)\cos(x)$, for $-\pi\le x \le \pi$.

I have calculated Fourier coefficients to be:

$a_0=-\frac{2}{\pi}$

$a_n=\frac{(-1)^n+1}{\pi n^2 - \pi}$

$b_n=\frac{n(-1)^n+n}{\pi n^2 - \pi}$

and so my series looks like this:

$F(x)=-\frac{1}{\pi}+\frac{2}{\pi} \sum\frac{cos(2nx)}{4n^2-1} +\frac{2}{\pi} \sum\frac{2nsin(2nx)}{4n^2-1}$.

Now, I see that my function $f$ has a discontinuity at $x=0$ so I use limits to find the value of $F(0)$:

$\lim_{x->0+}f(x)=1$

$\lim_{x->0-}f(x)=0$

$F(0)=\frac{0+1}{2}=\frac{1}{2}$.

Since $\sin{0}=0$ and $\cos{0}=1$, I have:

$\frac{1}{2}=-\frac{1}{\pi}+\frac{2}{\pi} \sum\frac{1}{4n^2-1}$.

Solving that gives me:

$\sum_{n=1}^{\infty}\frac{1}{4n^2-1}=\frac{\pi}{4}+\frac{1}{2}$

which is wrong according to Wolfram Alpha (WA solution doesn't have $\frac{\pi}{4}$).

What am I doing wrong? Is the discontinuity causing the problem? Is my goal even to find that sum?

Let us put this straight: the Fourier series of $f(x)$ is not the written one. Assuming $$\theta(x)=\left\{\begin{array}{rcl}0&\text{if}& x<0\\\tfrac{1}{2}&\text{if}& x=0\\1&\text{if}& x>0\end{array}\right.$$ we have that the Fourier series of $\theta(-x)\sin(x)+\theta(x)\cos(x)$ over $[-\pi,\pi]$ is given by $$-\frac{1}{\pi}+\frac{1}{2}\cos(x)+\frac{2}{\pi}\sum_{n\geq 1}\frac{\cos(2nx)}{4n^2-1}+\frac{1}{2}\sin(x)+\frac{4}{\pi}\sum_{n\geq 1}\frac{n\sin(2nx)}{4n^2-1}$$ and the evaluation of such series at $x=0$ leads to the value $$-\frac{1}{\pi}+\frac{1}{2}+\frac{1}{\pi}\sum_{n\geq 1}\left(\frac{1}{2n-1}-\frac{1}{2n+1}\right)=\frac{1}{2}$$ as expected from $\frac{1}{2}\left[\lim_{x\to 0^-}f(x)+\lim_{x\to 0^+}f(x)\right]$.