I need to find the Fourier series for $$f(x)=\frac{\pi -x}{2}, 0<x<2\pi$$
Since the interval isn't symmetric over $0$, I guess I need to consider $f$'s periodic extension to $\mathbb R$. let's call it $g$. Then $$g(x)=\begin{cases}\frac{\pi -x}{2}, \text{ if } 0<x<\pi\\ \frac{-\pi -x}{2}, \text{ if }{-\pi <x<0}\end{cases}$$
Due to $g$ being odd, the fourier coefficients $a_n$ are all $0$.
And $$b_n=\frac{2}{\pi}\int _0^\pi g(x)\sin(nx)dx=\frac{1}{\pi}\int _0^\pi (x-\pi)\sin (nx)dx$$ According to wolfram alpha $b_n=1/n$ so the Fourier series is $$\sum _{n=1}^{+\infty}\frac{\sin(kx)}{n}$$
But when I check the result of $x=1/2$ I get this which seems to diverge. It also fails for $x=\pi /2$ and a few other $x$'s.
What am I doing wrong?
I just saw this question. it looks like my answer is correct. am I doing anything wrong in my verification?
EDIT: I realised I forgot to divide by $\pi$. I fixed that but it still doesn't work. I also updated the links.