How find this value $\inf_{n\ge 1}\left(\min_{x\in[0,\frac{\pi}{2}]}\left(\sum_{k=1}^{n}\frac{\cos{(kx)}}{k}\right)\right)$ Find this 

$$\inf_{n\ge 1}\left(\min_{x\in[0,\dfrac{\pi}{2}]}\left(\sum_{k=1}^{n}\dfrac{\cos{(kx)}}{k}\right)\right)$$

I know this Young inequality
$$\sum_{k=1}^{n}\dfrac{\cos{(kx)}}{k}>-1,x\in[0,\pi]$$
but my problem is $x\in [0,\dfrac{\pi}{2}]$,so mayve I guess 
$$\inf_{n\ge 1}\left(\min_{x\in[0,\dfrac{\pi}{2}]}\left(\sum_{k=1}^{n}\dfrac{\cos{(kx)}}{k}\right)\right)=-\dfrac{1}{2}?$$
Thank you for you help
 A: Plotting the functions $$f_n(x):=\sum_{k=1}^n{\cos(k x)\over k}\qquad\left(0\leq x\leq{\pi\over2}\right)$$
for $1\leq n\leq 40$ indicates that instead of the $\inf$ of the minima we actually have a minimum, namely the value
$$f_2\left({\pi\over2}\right)=f_3\left({\pi\over2}\right)=-{1\over2}\ .$$

A: Too long for a comment:
$$f(x)=\sum_1^n\frac{\cos(kx)}k\quad\iff\quad f_\text{min}(x)\in\bigg\{f(x_0)\ |\ f'(x_0)=0\bigg\}\bigcup\bigg\{f(0),f\left(\frac\pi2\right)\bigg\}$$
$$f'(x)=-\sum_1^n\sin(kx)=\frac{\sin\left(n\cdot\frac x2\right)\sin\left((n+1)\cdot\frac x2\right)}{\sin\frac x2}=0\iff \begin{align}&x=\frac{2p+1}n\cdot\pi\\\\\\\\\\&x=\frac{2p+1}{n+1}\cdot\pi\end{align}$$
$$\begin{align}&p\in\mathbb{N}\\&p\leqslant\frac n4-\frac12\end{align}\quad;\quad f(0)=\sum_1^n\frac1k=H_n\quad;\quad\lim_{n\to\infty}\ f_n\left(\frac\pi2\right)=\sum_1^\infty\frac{(-1)^{k+1}}{2k}=-\frac{\ln2}2$$
$$f_1\left(\frac\pi2\right)=0\quad,\quad f_{2,3}\left(\frac\pi2\right)=-\frac12\quad,\quad 0>f_n\left(\frac\pi2\right)>-\frac12,\quad\forall\ n>3$$
The last statement can be proven by induction, and grouping the terms in pairs. Now all that's left to do is proving that $f\bigg(\displaystyle\frac{2p+1}{n[+1]}\cdot\pi\bigg)>-\frac12$ .
