How can I show $\sum_{k=1}^{\infty}\frac{\sin{kx}}{k}=\frac{\pi-x}{2}$? I'm trying to show that $$\sum_{k=1}^{\infty}\frac{\sin{kx}}{k}=\frac{\pi-x}{2}$$ using the Taylor series.
I tried to do it by first expanding a general formula $$f(g(x)) = f(g(a)) + xg'(a)f'(g(a)) +\frac{1}{2}x^2(g'(a)^2f''(g(a)+ g''(a) f'(g(a))) + HOT $$
Taking $ f(x) = \sin x$ and $ g(x) = kx$ and expanding around a=0,
$ \sin(kx) = kx - \frac{(kx)^3}{3!} + \frac{(kx)^5}{5!}..$
Now, from here is there any way I could arrive at the formula in question?
 A: Note, for $x \in (0,2\pi)$,
\begin{align} \sum_{k=1}^{\infty}\frac{\sin(kx )}{k}
&=\sum_{k=1}^{\infty}\frac{e^{ikx }-e^{-ikx}}{2ik}
=\frac{\ln (1-e^{-ix})- \ln(1-e^{ix}) }{2i}\\
& =\frac1{2i}\ln \frac{1-e^{-ix }}{1-e^{ix}} 
=\frac1{2i}\ln e^{i (\pi-x)}
=\frac{\pi-x}{2}\\
\end{align}
A: $$S=\sum_{k=1}^{\infty} \frac{\sin kx}{k}=\Im\sum_{k=1}^{\infty} \frac{e^{ikx}}{k}=-\Im \left( \ln(1-e^{ix})\right)=-\Im[\ln [1-\cos x)+i\sin x]$$ $$=-\Im \left[\ln(2-2\cos x)+i\tan^{-1} \frac{\sin x}{1-\cos x}\right]=-\tan^{-1}\cot(x/2)=\frac{x}{2}-\frac{\pi}{2}.$$Here we have used :$-\ln (1-x)=\sum_{k=0}^{\infty} \frac{x^k}{k}$ and $\ln (x+iy)= \ln \sqrt{x^2+y^2}+i\tan^{-1}\frac{y}{x}.$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
\left.\sum_{k = 1}^{\infty}{\sin\pars{kx} \over k}
\,\right\vert_{\ x\ \not=\ 0} & =
x\sum_{k = 1}^{\infty}\mrm{sinc}\pars{k\verts{x}} =
-x + x\sum_{k = 0}^{\infty}\mrm{sinc}\pars{k\verts{x}}
\end{align}
In using the Abel-Plana Formula, we have to ensure that
\begin{align}
0 & = \lim_{\large\verts{k_{y}} \to \infty}
\braces{\mrm{sinc}\pars{\bracks{k_{x} + \ic k_{y}}\verts{x}}
\expo{\large -2\pi\verts{k_{y}}}}
\\[5mm] & =
{\exp\pars{-\ic\,\mrm{sgn}\pars{k_{y}}k_{x}\verts{x}}
\over 2\verts{x}}
\lim_{\large\verts{k_{y}} \to \infty}{\exp\pars{-\bracks{2\pi - \verts{x}}\verts{k_{y}}} \over \verts{k_{y}}}
\end{align}
which is true whenever $\ds{\color{red}{\verts{x} < 2\pi}}$.
In such a case,
\begin{align}
\left.\sum_{k = 1}^{\infty}{\sin\pars{kx} \over k}
\,\right\vert_{\ x\ \not=\ 0} & =
-x + x\sum_{k = 0}^{\infty}\mrm{sinc}\pars{k\verts{x}}
\\[5mm] & =
-x + x\bracks{%
\underbrace{\int_{0}^{\infty}\mrm{sinc}\pars{k\verts{x}}\,\dd k}
_{\ds{\pi \over 2\verts{x}}}\ +\
\left.{1 \over 2}\,\mrm{sinc}\pars{k\verts{x}}\right\vert_{\ k\ =\ 0}}
\\[5mm] & =
\bbx{{1 \over 2}\bracks{\pi\,\mrm{sgn}\pars{x} - x}\,,\quad
0 < \verts{x} < 2\pi} \\ &
\end{align}
