TITLE: Find the limit of this sequence
QUESTION [5 upvotes]: Suppose $$
f_n(x)=\sum_{k=1}^n \frac{\cos(kx)}{k},
$$ 
and let $a_n=\min_{x \in [0,\pi/2]} f_n(x)$, find 
 $\lim_{n \to\infty} a_n$.
I wrote a program and found that the 
$\arg\min_{x \in [0,\pi/2]} f_n(x)$ is always close to $\pi/2$, 
and the limit of $\{a_n\}$ seems to be $-\ln(2)/2$.
Can anyone give a proof?

REPLY [2 votes]: Using the Taylor expansion
$$-\log(1-t) = \sum_{k=1}^\infty\frac{t^k}k,$$
$$
-\log(1-e^{ix}) = \sum_{k=1}^\infty\frac{(e^{ix})^k}k = \sum_{k=1}^\infty\frac{e^{ikx}}k =
\sum_{k=1}^\infty\frac{\cos(kx)}k + i \sum_{k=1}^\infty\frac{\sin(kx)}k 
$$
and your sum is the $n$-th partial sum of the real part.
But
$$f(x) = \Re(-\log(1-e^{ix})) = -\frac12\log 2 - \frac12\log(1-\cos x)$$
Can be proved (Dirichlet test) that $f_n\to f$ uniformly in $[\epsilon,\pi/2], \epsilon>0$, and using max {$f_n(x):x\in[a,b]$}$\to$ max{$f(x):x\in[a,b]$},
$$\min f_n\to\min f.$$