Sum of $\sin(kx)/k = \pi-x/2$

i need to show this equality: $$\sum_{k=1}^n \frac{\sin(kx)}{k} = \frac{\pi - x}{2}$$

I should use that $$\displaystyle\frac{\sin(kx)}{k} = \int_\pi ^x \cos(kt)\,\mathrm dt$$.

I tried many times to solve this, but I just got stuck. Is there a trick or anything I don't see?

• Do you know what the sum of $\cos(kx)$ is with respect to $k$? – Chinny84 May 16 '17 at 20:53
• That holds only for $x\in(0,2\pi)$ when you consider the limit as $n\to +\infty$. It is a standard exercise in Fourier series than can be simply tackled through $\sin(z)=\text{Im}\,e^{iz}$ and $\sum_{n\geq 1}\frac{z^n}{n}=\log(1-z)$ for any $z$ such that $|z|<1$. – Jack D'Aurizio May 16 '17 at 20:55
• well ..i got as far as $\int_\pi ^x \frac{sin(nt/2)* cos(tn+t))/2)}{sin(t/2) }dt$ do you mean that? – wondering1123 May 16 '17 at 20:57
• we dont do fourier analysis yet..:( – wondering1123 May 16 '17 at 20:58

$$\displaystyle \sum_{k=1}^n \dfrac{\sin(kx)}{k} = \int_\pi ^x \sum_{k=1}^n \cos(kt)\,\mathrm dt$$ by linearity of integral then write $$\displaystyle\sum_{k=1}^n \cos(kt)$$ as the real part of $$\displaystyle\sum_{k=1}^n e^{ikt}$$ which is a geometric sum.
$$\sum\limits_{k=1}^n{\sin(kx)\over k} = -\sum\limits_{k=1}^n\int\limits_0^x\cos(kx)dx = -\Re\int\limits_0^x\left(\sum\limits_{k=1}^ne^{ikx}\right)dx = -\Re\int\limits_0^x{e^{ikx}\over1-e^{ikx}}dx$$ $$= \Re\left({1\over ik}\int\limits_0^x{d\left(1-e^{ikx}\right)\over1-e^{ikx}}dx\right) = \Re\left({1\over ik}\log(1-ikx)\right) = {1\over k}\Im\log(1-ikx) = {1\over k}\left(\arg(1-ikx)+2\pi m\right) = {1\over k}\left(-\arctan kx+2\pi m\right)$$