# How to prove $\int_0^\pi\biggl |\sum_{i=0}^k \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr| \, dx \le c(k+1)$ for some constant $c$?

Let $$|a_i|\le1$$, prove that $$\int_0^\pi \biggl|\sum_{i=0}^k \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr|\,dx \le c(k+1)$$ for some constant $$c$$.

I tried to solve the question as follows $$\int_0^\pi \biggl|\sum_{i=0}^k \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr| \, dx \le \int_0^\pi \sum_{i=0}^k \biggl| \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr|\,dx \\= \sum_{i=0}^k|a_{i}|\int_0^\pi \biggl| \frac{\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr|\,dx \le \sum_{i=0}^k\int_0^\pi \biggl| \frac{\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr| \, dx.$$ Then it looks like a classic equality about Lebesgue constant, $$\frac{1}{\pi}\int_{-\pi}^\pi \biggl| \frac{\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr|\,dx=\frac{4}{\pi^2}\log i+O(1).$$ However, it didn't work. The above process of estimation doesn't seem to be careful enough.
How to make more careful and effective estimates to solve the question?
Thank you so much!

• If you divide through by $k+1$, when all $a_i$ are equal you get $a_0$ times the Fejér kernel. Since most of the mass of the Dirichlet kernel is near $0$ it's plausible that this situation is more or less the worst case. But proving that looks harder. Jul 30, 2020 at 17:39
• what is wrong with $\sum_{i=1}^k(\log i+O(1)) = O(k) + O(\log k)=O(k)?$ Jul 30, 2020 at 22:17
• @dezdichado For any constant $c$, $O(k)\geq c(k+1).$ Aug 1, 2020 at 12:47
• If something is O(k), then it's also O(k+1) Aug 1, 2020 at 18:39

I copied the proof roughly here. $$\int_0^\pi \biggl|\sum_{i=0}^k \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr| \, dx = \int_0^\frac{\pi}{k+1} \biggl|\sum_{i=0}^k \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr| \, dx+\int_\frac{\pi}{k+1}^\pi \biggl|\sum_{i=0}^k \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr| \, dx$$ It is easy to get that $$\frac{\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x} \le i+\frac12.$$ Then $$\int_0^\frac{\pi}{k+1} \biggl|\sum_{i=0}^k \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr| \, dx \le \frac{\pi}{k+1}\sum_{i=0}^{k}|a_i|\biggl(i+\frac12\biggr) \le \frac\pi2(k+1).$$ According to Cauchy-Schwarz inequality,we have $$\int_\frac{\pi}{k+1}^\pi \biggl|\sum_{i=0}^k \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr| \, dx \le \sqrt{\int_\frac{\pi}{k+1}^\pi \biggl(\frac{1}{2\sin \frac{1}{2}x}\biggr)^2 \, dx}\sqrt{\int_\frac{\pi}{k+1}^\pi \biggl(\sum_{i=0}^k a_i\sin(i+\frac{1}{2})x\biggr)^2 \, dx}.$$ After calculation,we get that $$\int_\frac{\pi}{k+1}^\pi \biggl(\frac{1}{2\sin \frac{1}{2}x}\biggr)^2 \, dx \lt 2k+2,$$ and $$\int_\frac{\pi}{k+1}^\pi \biggl(\sum_{i=0}^k a_i\sin(i+\frac{1}{2})x\biggr)^2 \, dx \le \int_{-\pi}^\pi \biggl(\sum_{i=0}^k a_i\sin(i+\frac{1}{2})x\biggr)^2 \, dx=\pi\sum_{i=0}^{k}a_i^2 \le \pi(k+1).$$ Therefore, $$\int_\frac{\pi}{k+1}^\pi \biggl|\sum_{i=0}^k \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr| \, dx \le \sqrt{2\pi}(k+1).$$ In brief, we come to the conclusion $$\int_0^\pi \biggl|\sum_{i=0}^k \frac{a_i\sin(i+\frac{1}{2})x}{2\sin \frac{1}{2}x}\biggr| \, dx \le (\frac\pi2+\sqrt{2\pi})(k+1).$$