# $\sum_{n=0}^{\infty}\frac{\sin(2n+1)x}{2n+1}$

I need to find $$\sum_{n=0}^{\infty}\frac{\sin(2n+1)x}{2n+1}$$

I know that if I find a appropriate function and expand it as a Fouries series, I can find the sum. But it seems to me like way with a hindsight. I don't know the way to find the function directly if I don't know the answer already. So I proceeded like this: \begin{align*} \sum_{n=0}^{\infty}\frac{\sin(2n+1)x}{2n+1} & =Im\sum\frac{e^{i\left(2n+1\right)x}}{2n+1}\\ & =\frac{1}{2}Im\left\{ \ln\left(1+e^{ix}\right)-\ln\left(1-e^{ix}\right)\right\} \\ & =\frac{1}{2}\Im\left[\ln\left\{ e^{\dfrac{ix}{2}}\left(e^{\dfrac{-ix}{2}}+e^{\dfrac{ix}{2}}\right)\right\} -ln\left\{ e^{\dfrac{ix}{2}}\left(e^{\dfrac{-ix}{2}}-e^{\dfrac{ix}{2}}\right)\right\} \right]\\ & =\frac{1}{2}\Im\left\{ \ln\left(2e^{\dfrac{ix}{2}}\cos\frac{x}{2}\right)-\ln\left(-2ie^{\dfrac{ix}{2}}\sin\frac{x}{2}\right)\right\} \\ & =\frac{1}{2}\Im\left(\ln\cos\frac{x}{2}-\ln\left(-i\right)-\ln\left(\sin x\right)\right)\\ & =\frac{1}{2} \Im\left(\ln\cot\frac{x}{2}-\ln e^{-\dfrac{\pi i}{2}}\right)\\ & =\frac{\pi}{4} \end{align*}

But the answer should be $-\pi/4$ for x in $(-\pi,0)$. I'm not sure how to distinguish the answer for different value of x. And I cannot find where I failed to make distinction.

• Many of your steps cannot be justified. What exactly is your $\ln$? What branch of logarithm are you using? The series expansion of $\ln (1+x)-\ln (1-x)$ is valid for $x \in (-1,1)$ but not for complex numbers in general. Since you are dealing with series that are not absolutely convergent it is no surprise that you got a wrong answer. Commented Apr 5, 2018 at 10:21