Compute $\sum_{n=0}^\infty \frac {\sin ((2n+1)\phi)}{2n+1}$ for $0<\phi<\pi$ Compute $\sum_{n=0}^\infty \frac {\sin ((2n+1)\phi)}{2n+1}$ for $0<\phi<\pi$
I just want to make sure I did this one correctly.
Can I do this 
$$\sum_{n=0}^\infty \frac {\sin ((2n+1)\phi)}{2n+1}=\sum_{n=1}^\infty \frac {\sin ((2(n-1)+1)\phi)}{2(n-1)+1}=\sum_{n=1}^\infty \frac {\sin ((2n-1)\phi)}{2n-1}?$$
if so, then 
$$\sin((2n-1)\phi)=\frac{e^{i(2n-1)\phi}-e^{-i(2n-1)\phi}}{2i}$$
plug into the series I have 
$$\sum_{n=1}^\infty \frac {\sin ((2n-1)\phi)}{2n-1}=\frac{1}{2i}(\sum_{n=1}^\infty \frac {e^{i(2n-1)\phi}}{2n-1}- \sum_{n=1}^\infty \frac {e^{-i(2n-1)\phi}}{2n-1}) $$
Use the property $-\log(1-z)=\sum_{n=1}^\infty \frac{z^n}{n}$, I got 
$$\frac{1}{2i}(\sum_{n=1}^\infty \frac {e^{i(2n-1)\phi}}{2n-1}- \sum_{n=1}^\infty \frac {e^{-i(2n-1)\phi}}{2n-1})= \frac{1}{2i}(-\log {(1-e^{i\phi})}+\log{(1-e^{-i\phi})})$$
$$=-\frac{1}{2i}\log(\frac{1-e^{i\phi}}{1-e^{-i\phi}})$$
$$=-\frac{1}{2i}\log(\frac{2-\cos (\phi)}{1-2e^{-i\phi}+e^{-2i\phi}})$$
How do I simplify further from here ? Or did I do something wrong? I wonder if anyone would please check it for me.
 A: Formal manipulations give:
$$\sum_{n=0}^{+\infty}\frac{\sin((2n+1)\phi)}{2n+1}=\text{Im}\sum_{n\geq 0}\frac{e^{(2n+1)i\phi}}{2n+1}=\text{Im}\operatorname{arctanh}(e^{i\phi})=\frac{1}{2}\text{Im}\log\left(\frac{1+e^{i\phi}}{1-e^{i\phi}}\right)=\frac{\pi}{4}.$$
We can check that such identity holds over $(0,\pi)$ by computing the Fourier series of the rectangle wave with period $2\pi$.
A: Here is a method that one can use to evaluate infinite series of this type.
$$\begin{align}
f(\phi) &= \sum_{n=0}^{\infty} \frac{\sin (2n+1)\phi}{(2n+1)}\\\\
&=\text{Im}\left(\sum_{n=0}^{\infty} \frac{e^{i(2n+1)\phi}}{2n+1}\right)
\end{align}$$

To evaluate the series, we first assume that $\phi$ has a small positive imaginary part.  Then, taking a derivative with respect to $\phi$ reveals
$$f'(\phi)= \text{Im}\left(i \sum_{n=0}^{\infty} e^{i(2n+1)\phi}\right) $$
Inasmuch as we are assuming that $\phi$ has a small imaginary part, the sum is trivial to compute (i.e., it is the sum of an infinite geometric series) and we see that
$$\begin{align}
f'(\phi)&= \text{Im}\left( \frac{i e^{i\phi}}{1-e^{i2\phi}}\right)\\\\ 
&=\text{Im}\left(-\frac12 \csc \phi\right)\\\\
&=0  
\end{align}$$
Thus, $f(\phi)$ is constant!  Next, we will develop the Fourier series for a constant function on $(0,\pi)$.

So, let's write the Fourier series for an odd, periodic function $g$ that is a constant equal to $1$ on $(0,\pi)$.  Then,
$$\begin{align}
g(\phi)&=1\\\\
& = \sum_{n=1}^{\infty} a_n \sin (n\phi)  
\end{align}$$
Computing the Fourier coefficients $a_n$, we see that
$$a_n=\frac{2}{\pi} \frac{1-(-1)^n}{n}  \tag{4}$$
Thus,
$$\begin{align}
g(\phi)&=\frac{2}{\pi} \sum_{n=1}^{\infty} \frac{1-(-1)^n}{n} \sin n\phi\\\\
&=\frac{4}{\pi} \sum_{n =0} \frac{\sin((2 n+1)\phi)}{2n+1} \tag{5} 
\end{align}$$
and thus for $0<\phi<\pi$
$$\bbox[5px,border:2px solid #C0A000]{f(\phi) = \frac{\pi}{4}}$$


Incidentally, the method used here applies to the series
$$\begin{align}
\sum_{n=0}^{\infty} \frac{\cos (2n+1)\phi}{(2n+1)}&=\text{Re}\left(\sum_{n=0}^{\infty} \frac{e^{i(2n+1)\phi}}{2n+1}\right)\\\\
&=\int \text{Re}\left(-\frac12 \csc \phi\right)d\phi\\\\
&=-\frac12 \log\left(\tan(\frac{\phi}{2})\right)+C\\\\
&=-\frac12 \log\left(\tan(\frac{\phi}{2})\right)
\end{align}$$
where the constant $C=0$ was found by noting that the series $\sum_{n=0}^{\infty} \frac{\cos (2n+1)\phi}{(2n+1)}=0$ for $\phi=\pi/2$.
A: The problem in your computation is that $$\sum_{k=1}^\infty\frac{e^{i(2n-1)\phi}}{2n-1}$$ is the sum over only the odd terms, whereas $$-\log(1-z)=\sum_{k=1}^\infty\frac{z^n}{n}$$ is the sum over all terms.
The proper series to use is
$$
\sum_{k=1}^\infty\frac{z^{2n-1}}{2n-1}=\frac12\log\left(\frac{1+z}{1-z}\right)
$$
Jack D'Aurizio uses this in his answer.
