<s>[INST] Prove $\sum^{n+1}_{j=1}\left|\cos\left(j\cdot x\right)\right|\geqslant \frac n4$ How do you prove that $\displaystyle\sum^{n+1}_{j=1}\left|\cos\left(j\cdot x\right)\right|\geqslant \dfrac{n}{4}$, where $x\in\mathbb{R}$?
I tried mathematical induction, but it doesn't work. I also have some ideas on complex number solution, such as setting $z=\cos\left(x\right)+i\sin\left(x\right)$ and working on $Re\left(z\right)$, but neither does that work.
 [/INST] By periodicity $\left|\cos(jx)\right|=|\cos (j(\pi+x))|=|\cos (j(\pi-x))|$ and the fact that $\cos$ even, it's enough to assume $0 <x \le \pi/2$ as the inequality is obvious for $x=0$.
Note that $|\cos x|+|\cos 2x| \geqslant \dfrac{\sqrt{2}}{2} $ with equality at $x=\pi/4$ (splitting into $0 \leqslant x \leqslant \pi/4, \pi/4 \le x \le \pi/2$ and expliciting one gets a quadratic in $\cos x$ etc) so we can assume $n \ge 3$ since $\sqrt 2/2 \ge n/4$ for $n=1,2$
Now $$\sum^{n+1}_{j=1}|\cos(jx)| \ge \sum^{n+1}_{j=1}\cos^2(jx)=\frac{n+1}{2}+\frac{1}{2}\sum^{n+1}_{j=1}\cos(2jx)$$
Now $\sum^{n+1}_{j=1}\cos(2jx)=(\frac{\sin ((2n+3)x)}{\sin x}-1)/2$ and we know that $\sin x \ge \frac{2x}{\pi}$ so $$|(\frac{\sin ((2n+3)x)}{\sin x}-1)/2| \le \frac{1}{2}(\frac{\pi}{2x}+1)$$
Hence if $\frac{\pi}{2x}+1 \le n+2$ or $x \ge \frac{\pi}{2n+2}$ we have $$\sum^{n+1}_{j=1}|\cos(jx)| \ge \frac{n+1}{2}-\frac{1}{2}|(\frac{\sin ((2n+3)x)}{\sin x}-1)/2| \ge \frac{n+1}{2}-\frac{n+2}{4}=\frac{n}{4}$$
If $x \le \frac{\pi}{2n+3}$ then $(2n+3)x \le \pi$ so $\frac{\sin ((2n+3)x)}{\sin x} \ge 0$ hence $$\sum^{n+1}_{j=1}|\cos(jx)| \ge \frac{n+1}{2}-\frac{1}{4}\geqslant \frac{n}{4}$$
hence assume $\frac{\pi}{2n+3} \le x \le \frac{\pi}{2(n+1)}$ then all $\cos jx \geqslant 0, j=1,..n+1$ since $(n+1)x \leqslant \pi/2$ hence:
$$\sum^{n+1}_{j=1}|\cos(jx)|=\sum^{n+1}_{j=1}\cos(jx)=(\frac{\sin ((n+3/2)x)}{\sin x/2}-1)/2$$
$\frac{\pi}{2}\le (n+3/2)x \le \frac{\pi}{2}+\frac{\pi}{4n+4}$ so $\sin ((n+3/2)x) \ge \cos \frac{\pi}{4n+4} \ge 1- (\frac{\pi}{4n+4})^2/2 $ while $\sin x/2 \le x/2 \le \frac{\pi}{4n+4}$ so $\frac{1}{ \sin x/2} \ge \frac{4n+4}{\pi}$, hence
$$2\sum^{n+1}_{j=1}|\cos(jx)| \ge \frac{4n+4}{\pi}(1- (\frac{\pi}{4n+4})^2/2 ) -1 \ge \frac{4n}{\pi}+4/\pi - \pi/32-1\ge \frac{n}{2}$$ since $n \ge 3$, so we are done!
Now $\int_0^{\pi/2}|\cos jx|dx=1, j \ge 1$ so $\int_0^{\pi/2}\sum^{n+1}_{j=1}|\cos(jx)|dx=n+1$ which suggests that the average sum is about $\frac{2n+2}{\pi}$ hence the lower bound $n/4$ most likely can be improved
</s>