Fourier series with all coefficients $\frac1n$ The function with Fourier series given by
$$f(x)=\sum_{n=1}^\infty \frac{\cos{(nx)}+\sin{(nx)}}n$$
appears to be a curve with vertical asymptotes at $x=2\pi k$ where $k\in\mathbb{Z}$. Is there an elementary closed form for $f(x)$? Wolfram gives us
$$f(x)=-\frac12(1+i)(\ln{(1-e^{-ix})}-i\ln{(1 - e^{ix})})$$
but is there a way to simplify the above expression into one which does not involve complex numbers as the function $f(x)$ is clearly real?
Edit:
I found that this question may have been asked in different contexts before. I have provided a proof of the related results as one of the answers below.
 A: We can solve each of the sums seperately by considering the sum as the real or imaginary part of
$$\sum_{n=1}^\infty \frac{e^{inx}}n=-\ln{(1-e^{ix})},\qquad x\in\mathbb{R}\setminus \{0\}$$
Then we can use the fact that
$$\ln{(z)}=\ln{(|z|)}+i\arg{(z)}$$
to seperate the above function into its real and imaginary parts;
$$\begin{align}
-\ln{(1-e^{ix})}
&=-\ln{(1-\cos{(x)}-i\sin{(x)})}\\
&=-\ln{(|1-\cos{(x)}-i\sin{(x)}|)}-i\arg{(1-\cos{(x)}-i\sin{(x)})}\\
&=-\frac12\ln{((1-\cos{(x)})^2+(\sin{(x)})^2)}-i\arctan{\left(\frac{-\sin{(x)}}{1-\cos{(x)}}\right)}\\
&=-\frac12\ln{(2-2\cos{(x)})}+i\arctan{\left(\frac{\sin{(x)}}{1-\cos{(x)}}\right)}\\
&=-\frac12\ln{\left(4\sin^2{\left(\frac{x}2\right)}\right)}+i\arctan{\left(\cot{\left(\frac{x}2\right)}\right)}\\
&=-\ln{\left(2\left|\sin{\left(\frac{x}2\right)}\right|\right)}+i\arctan{\left(\tan{\left(\frac{\pi-x}2\right)}\right)}\\
\end{align}$$
Hence we can evaluate the two sums as
$$\sum_{n=1}^\infty \frac{\cos{(nx)}}n=\Re{\left(\sum_{n=1}^\infty \frac{e^{inx}}n\right)}=-\ln{\left(2\left|\sin{\left(\frac{x}2\right)}\right|\right)}$$
$$\sum_{n=1}^\infty \frac{\sin{(nx)}}n=\Im{\left(\sum_{n=1}^\infty \frac{e^{inx}}n\right)}=\arctan{\left(\tan{\left(\frac{\pi-x}2\right)}\right)}$$
For $x\in(0,2\pi)$ this simplifies to the results
$$\sum_{n=1}^\infty \frac{\cos{(nx)}}n=-\ln{\left(2\sin{\left(\frac{x}2\right)}\right)}$$
$$\sum_{n=1}^\infty \frac{\sin{(nx)}}n=\frac{\pi-x}2$$
A: $$ f(x) = - \frac{\ln(2-2\cos(x))}{2} + \arctan\left(\frac{\sin(x)}{1-\cos(x)}\right)$$
