Find all real numbers $a_{1}, a_{2}, \ldots, a_{n}$ such that for every real $x$,

$$
a_{1} \cos x+a_{2} \cos 2 x+\ldots+a_{k} \cos k x+\ldots+a_{n} \cos n x=0
$$
Find all real numbers $a_{1}, a_{2}, \ldots, a_{n}$ such that for every real $x$,

$$
a_{1} \cos x + a_{2} \cos 2 x + \ldots + a_{k} \cos k x + \ldots + a_{n} \cos n x = 0
$$

I. Solution. We will prove that $\cos k x$ can be expressed as a polynomial of $\cos x$ of degree at most $k$. We will use induction. For $k=1$, the statement is obvious, and for $k=2$, it follows from the identity $\cos 2 x = 2 \cos^2 x - 1$. Assume that $\cos k x$ can be expressed as a polynomial of $\cos x$ of degree at most $k$ for all $k < m$. Then, from the identity

$$
2 \cos (m-1) x \cos x = \cos (m-2) x + \cos m x
$$

we have $\cos m x = 2 \cos (m-1) x \cos x - \cos (m-2) x$. By the induction hypothesis, $\cos (m-1) x$ is a polynomial of $\cos x$ of degree at most $m-1$, and $\cos (m-2) x$ is a polynomial of $\cos x$ of degree at most $m-1$. Therefore, the right-hand side is a polynomial of $\cos x$ of degree at most $m$. This proves that $\cos m x$ is a polynomial of $\cos x$ of degree at most $m$.

From this, it follows that $a_{1} \cos x + a_{2} \cos 2 x + \ldots + a_{n-1} \cos (n-1) x$ can be expressed as a polynomial of $\cos x$ of degree at most $n-1$. Therefore, there exists a polynomial $p(y)$ of degree at most $n-1$ such that

$$
p(\cos x) = a_{1} \cos x + a_{2} \cos 2 x + \ldots + a_{n-1} \cos (n-1) x
$$

for all $x$. If (1) holds for all $x$, then

$$
p(\cos x) = -a_{n} \cos n x
$$

for all $x$.

Let

$$
x_{1} = \frac{\pi}{2 n}, \ldots, x_{j} = \frac{(2 j-1) \pi}{2 n}, \ldots, x_{n} = \frac{(2 n-1) \pi}{2 n}
$$

For each such $x_{j}$,

$$
\cos n x_{j} = \cos \frac{(2 j-1) \pi}{2} = 0
$$

and the values $y_{1} = \cos x_{1}, \ldots, y_{j} = \cos x_{j}, \ldots, y_{n} = \cos x_{n}$ are distinct. Therefore, by (1) and (2),

$$
p(y_{j}) = p(\cos x_{j}) = -a_{n} \cos n x_{j} = 0
$$

Thus, $y_{1}, \ldots, y_{j}, \ldots, y_{n}$ are $n$ distinct roots of the polynomial $p(y)$. Since $p(y)$ is of degree at most $n-1$, it can only have $n$ distinct roots if it is identically zero. Therefore,

$$
0 \equiv p(\cos x) \equiv -a_{n} \cos n x
$$

which implies $a_{n} = 0$, since $\cos n x$ is not identically zero.

By repeating this argument $(n-1)$ times, we get $a_{n-1} = 0, a_{n-2} = 0, \ldots, a_{1} = 0$. Therefore, the function $a_{1} \cos x + a_{2} \cos 2 x + \ldots + a_{n} \cos n x = f(x)$ is identically zero if and only if $a_{1} = a_{2} = \ldots = a_{n} = 0$. In this case, it is indeed zero for all $x$.

II. Solution. We will prove that if any $a_{k} \neq 0$, then the function $f(x) = a_{1} \cos x + a_{2} \cos 2 x + \ldots + a_{n} \cos n x$ cannot be identically zero. To this end, multiply the function $f(x)$ by $\cos k x$ and integrate the product from $0$ to $2 \pi$. The integral of the $l$-th term of $f(x) \cos k x$, if $l \neq k$:

$$
\begin{aligned}
& a_{l} \int_{0}^{2 \pi} \cos l x \cos k x \, dx = \frac{1}{2} a_{l} \int_{0}^{2 \pi} (\cos (k+l) x + \cos (k-l) x) \, dx = \\
& = \frac{1}{2} a_{l} \left[ \frac{\sin (k+l) x}{k+l} + \frac{\sin (k-l) x}{k-l} \right]_{0}^{2 \pi}
\end{aligned}
$$

The integral of the $k$-th term:

$$
\begin{aligned}
& a_{k} \int_{0}^{2 \pi} \cos^2 k x \, dx = \frac{1}{2} a_{k} \int_{0}^{2 \pi} (\cos 2 k x + 1) \, dx = \\
& = \frac{1}{2} a_{k} \left[ \frac{\sin 2 k x}{2 k} + x \right]_{0}^{2 \pi} = \frac{1}{2} a_{k} \cdot 2 \pi = a_{k} \pi \neq 0
\end{aligned}
$$

Therefore,

$$
\int_{0}^{2 \pi} f(x) \cos k x \, dx = a_{k} \pi \neq 0
$$

which cannot hold if $f(x)$, and hence $f(x) \cos k x$, were zero for all $x$. This proves that if any $a_{k} \neq 0$, then $f(x)$ is not identically zero. Therefore, $a_{1} \cos x + a_{2} \cos 2 x + \ldots + a_{k} \cos n x$ is zero for all $x$ if and only if $a_{1} = a_{2} = \ldots = a_{n} = 0$. In this case, the expression is indeed zero for all $x$.

Judit Helyei (Pécs, Leöwey K. Gymnasium, 4th grade)

Remark. In the first solution, we essentially proved the following: $\cos k x$ is a polynomial of $\cos x$ of degree exactly $k$. If $a_{1} \cos x + \ldots + a_{n} \cos n x = 0$ for all $x$, then $a_{1} \cos x + \ldots + a_{n-1} \cos (n-1) x \equiv -a_{n} \cos n x$. Here, the left-hand side is a polynomial of degree at most $n-1$, while the right-hand side is a polynomial of degree $n$ in $\cos x$ if $a_{n} \neq 0$, which is impossible since $\cos x$ takes infinitely many distinct values. This implies that $a_{n} = 0$.