If $n_1, n_2, ..., n_k$ are integers, prove that : $$\frac{1}{2\pi} \int_{0}^{2\pi}|1+e^{in_1x}+...+e^{in_kx}|dx \leq \sqrt{k+1}$$
my attempt : I want to solve the problem using Cauchy–Schwarz inequality :
$$|z|^2 = z. \bar{z}$$ then $$| \sum_{\kappa=0}^{k} e^{in_{\kappa}x}|^2 = (\sum_{\kappa = 0}^{k}e^{in_{\kappa}x}) (\sum_{\lambda = 0}^{k}e^{-in_{\lambda}x})$$
where $n_0=0$ and we need $n_i$ to be distinct nonzero integers
After that, how to show that $$\frac{1}{2\pi} \int_{0}^{2\pi}|1+e^{in_1x}+...+e^{in_kx}|dx \leq \sqrt{k+1}$$
The relevant version of the Cauchy-Schwarz inequality is
$$\left|\int f(x){\overline {g(x)}}\,dx\right|^{2}\leq \int |f(x)|^{2}\,dx\cdot \int |g(x)|^{2}\,dx$$
which works for any range of integration. Setting $f(x)=1+e^{in_1x}+\dots+e^{in_kx}$ and $g(x)=f(x)/|f(x)|$ (or $1$ if $f(x)=0$) gives
$$\left(\int_0^{2\pi} |f(x)|\,dx\right)^{2}\leq \int_0^{2\pi} |f(x)|^{2}\,dx\cdot \int_0^{2\pi} 1\,dx$$
The $|f(x)|^2=f(x)\overline{f(x)}$ is just a linear combination of exponentials, so can be easily evaluated as $2\pi(k+1)$ using the assumption that $0,n_1,\dots,n_k$ are distinct. This gives the desired bound $\frac{1}{2\pi}\int_0^{2\pi} |f(x)|\,dx\leq\sqrt{k+1}$.