Find the Maximum Trigonometric polynomial coefficient $A_{k}$ 
Let $n,k$ be given positive integers and $n\ge k$. Let $A_i, i=1, 2, \cdots, n$ be given real numbers. If for all real numbers $x$ we have $$A_{1}\cos{x}+A_{2}\cos{(2x)}+\cdots+A_{n}\cos{(nx)}\le 1$$
Find the maximum value of $A_{k}$.

I don't know if this question has been studied
If  $n=2$ it is easy to solve it.
 A: Since $\cos{kx} =\frac { e^{ikx} + e^{-ikx}}{2}$ we can restate the condition in this form
let $$P(x) = 1 - \sum_{k=-n}^{k=n} \frac{A_{k}}{2}*e^{ikx}$$ where $A_{-k} = A_{k}$.
If $P(x) >= 0$ find the upper bound on $A_{k}$.
Now, there is a lemma due to Riesz which says that a real positive polynomial is a square. In words, that there is a trigonometric polynomial $Q(x) = \sum_{k=-n}^{k=n}\frac{1}{2\pi}a_{k}e^{ikx}$ such that $P(x) = |Q(x)|^{2} = Q(x)\overline Q(x)$
Multiplying out and comparing coefficients, one gets
$$\sum |a_{k}|^{2} = (2\pi)^{2}$$ and $$\frac{1}{2}A_{k} = (\frac{1}{2\pi})^{2}\sum a_{l}*\overline a_{l + k}$$
Then, if one applies Cauchy-Schwartz inequality to the last expression and uses the previous estimate on sum of squares of $a_{k}$'s one gets:
$$A_{k} <= 2$$
Not the optimal estimation (as the case n=1 shows) but a uniform one with respect to $n$.
A: NTstrucker@AoPS's answer:
It is a known result:
$$\max A_k = 2 \cos \frac{\pi}{\lfloor \frac{n}{k} \rfloor + 2}, \ 1\le k \le n.$$
See e.g. Theorem 16.2.4 in [1].
So, $\max A_1 = 2\cos \frac{\pi}{n + 2}$,
$\max A_m = 1$ for $\lfloor \frac{n}{2}\rfloor + 1 \le m \le n$,
$\max A_{\lfloor \frac{n}{2}\rfloor} = \sqrt{2}$.
[1] Qazi Ibadur Rahman and Gerhard Schmeisser, “Analytic Theory of Polynomials”, 2002.
A: COMMENT
May be this idea can help:
We use following identity:
$$\sin^2(x)+\sin^2(2x)+\sin^2 (3x)+ . . .+\sin^2(nx)=\frac{n\sin(x)-\sin(nx)\cos(n+1)x}{2\sin x}$$
Taking derivative of both sides we get:
$$2\sin(x)\cos(x)+4\sin(2x)\cos(2x)+6\sin(3x)\cos(3x)+ . . . 2n\sin(nx)\cos(nx)=\big(\frac{n\sin(x)-\sin(nx)\cos(n+1)x}{2\sin x}\big)'\leq 1$$
We solve derivative $\leq 1$, we get a relation between n and x which may be used to find maximum value of $A_k$.
In fact the proble can be reduced to:
If:
$\big(\frac{n\sin(x)-\sin(nx)\cos(n+1)x}{2\sin x}\big)'\leq 1$
Find maximum of  $A_n=f(x)= 2n\sin(nx)$
A: I'll just do a subcase of the $n=3$ case.
$A_{k}=1$ is the maximum for k=2, 3.
First notice that letting $A_{k}=1$ and taking the other values of $A_{j}=0$ we have
$$cos(kx)\leq 1$$
which holds for all x. So each $A_{k}$ is at least 1. Now we will show that each $A_{k}$ is at most 1 for $k=2,3$.
Plugging in $x=0$ gives us $A_{1}+A_{2}+A_{3} \leq 1$.
If $A_{3}>1$ then this forces $A_{1}+A_{2} \leq 1-A_{3} < 0$. However, plugging in $x=\frac{2\pi}{3}$ we have $A_{3} + \frac{-A_{1}-A_{2}}{2} \leq 1$
So $A_{3}\leq 1+\frac{A_{1}+A_{2}}{2} < 1$
Therefore $A_{3}\leq 1$ thus $A_{3}=1$.
If $A_{2}>1$ then $A_{1}+A_{3} \leq 1-A_{2} < 0$.
Plugging in $x=\pi$ we have $A_{2} + -A_{1}-A_{3} \leq 1$.
So $A_{2}\leq 1+ A_{1} + A_{3} < 1$.
Therefore $A_{2}\leq 1$ thus $A_{2}=1$.
A: My second answer:
Edit 2021/03/11
According to NTstrucker@AoPS's result (https://artofproblemsolving.com/community/c6h2477208), I give the following conjecture.
Conjecture 2: $\max A_1 = 2\cos \frac{\pi}{n+2}$.
When $n = 2$, $\max A_1 = \sqrt{2} = 2 \cos \frac{\pi}{4}$.
When $n = 3$, $\max A_1 = \frac{\sqrt{5} + 1}{2} = 2\cos \frac{\pi}{5}$.
When $n = 4$, $\max A_1 = \sqrt{3} = 2\cos \frac{\pi}{6}$.
When $n = 5$, $\max A_1 = 2\cos \frac{\pi}{7}$.
When $n = 6$, $\max A_1 \approx 1.8478$ (I only get numerical result) should be $2\cos \frac{\pi}{8}
\approx 1.847759065$.
When $n = 7$, $\max A_1 \approx 1.8794$ (I only get numerical result) should be $2\cos \frac{\pi}{9}
\approx 1.879385242$.
When $n = 8$, $\max A_1 \approx 1.9021$ (I only get numerical result) should be $2\cos \frac{\pi}{10}
\approx 1.902113033$.
When $n = 9$, $\max A_1 \approx 1.9190$ (I only get numerical result) should be $2\cos \frac{\pi}{11}
\approx 1.918985947$.
$\phantom{2}$
Let us prove that $\max A_m = 1$ if $\lfloor \frac{n}{2}\rfloor + 1 \le m \le n$.
We need Theorem 1. The proof is given at the end.
Theorem 1: Let $n\ge 2$ be a given integer. Let $A_i, i=1, 2, \cdots, n$ be given real numbers such
that $A_1\cos x + A_2 \cos 2x + \cdots + A_n \cos n x \le 1, \ \forall x\in \mathbb{R}$. Then
$A_m \le 1$ for $m = \lfloor \frac{n}{2}\rfloor + 1,  \cdots, n$.
By Theorem 1, we have immediately $\max A_m = 1$ if $\lfloor \frac{n}{2}\rfloor + 1 \le m \le n$
(simply let $A_m = 1$ and $A_k = 0$ for all $k\ne m$
and the condition $A_m \cos m x \le 1, \forall x\in \mathbb{R}$ is clearly satisfied.).
$\phantom{2}$
Proof of Theorem 1: First, we have Fact 1. The proof of Fact 1 is easy and thus omitted.
Fact 1: Let $M\ge 2$ be an integer. Let $K$ be a positive integer. Then
$$\frac{1}{M} + \frac{\cos K\pi}{M}\cdot \frac{1 + (-1)^M}{2}
+ \frac{2}{M}\sum_{j=1}^{\lfloor \frac{M+1}{2}\rfloor - 1} \cos \frac{2jK\pi}{M} = \left\{\begin{array}{cc}
                                                              0 & M \nmid K \\[5pt]
                                                              1 & M \mid K.
                                                            \end{array}
\right.$$
Second, we have Fact 2.
Fact 2: Let $n\ge 2$ be a given integer. Let $m$ be an integer with $\lfloor \frac{n}{2}\rfloor + 1 \le m \le n$.
Let $A_i, i= 1, 2, \cdots, n$ be given real numbers.
Let $f(x) = \sum_{k=1}^n A_k\cos (kx)$. Then
$$\frac{f(0)}{m} + \frac{f(\pi)}{m}\cdot \frac{1 + (-1)^m}{2}
+ \frac{2}{m}\sum_{j=1}^{\lfloor \frac{m+1}{2}\rfloor - 1} f\left(\frac{2j\pi}{m}\right) = A_m. $$
(Proof of Fact 2: It suffices to prove that
$$\frac{1}{m} + \frac{\cos k\pi}{m}\cdot \frac{1 + (-1)^m}{2}
+ \frac{2}{m}\sum_{j=1}^{\lfloor \frac{m+1}{2}\rfloor - 1} \cos \frac{2j k \pi}{m} = \left\{\begin{array}{cc}
                                                              0 & k \ne m \\[5pt]
                                                              1 & k = m.
                                                            \end{array}
\right. $$
This is true by Fact 1.)
By Fact 2, Theorem 1 is proved. We are done.
