Prove that $a_1 \cos(b_1 x) + \dots + a_n \cos(b_n x)$ has zero
Let $a_i,b_i>0$ for $i=1,...,n$ and let $$f(x)=\sum_{i=1}^na_i\cos(b_ix),\qquad g(x)=\sum_{i=1}^n\frac{a_i}{b_i}\sin(b_ix).$$ Clearly, $g(0)=0$ and $g^\prime=f$. We proceed by cases. If all the $b_i$ are rational, say $b_i=\frac{p_i}{q_i}$ with integer $p_i,q_i$ for $i=1,...,n$, then $$g\left(\pi\prod_{j=1}^nq_j\right)=\sum_{i=1}^n\frac{a_i}{b_i}\sin\left(b_i\pi\prod_{j=1}^nq_j\right)=\sum_{i=1}^n\frac{a_i}{b_i}\sin\left(p_i\pi\prod_{j=1,j\neq i}^nq_j\right)=0=g\left(0\right).$$ Obviously $\pi\prod_{j=1}^nq_j\neq0$, so by Rolle's theorem, there is a $\xi\in\left(0,\pi\prod_{j=1}^nq_j\right)$, such that $$f\left(\xi\right)=g^\prime\left(\xi\right)=0.$$ If, on the other hand, at least one of the $b_i$ is irrational, then, by Dirichlet's theorem on Diophantine approximations, there are integer sequences $(q_k)_k$ and $(p_{ik})_k$ for each $i=1,...,n$, such that $$\left\lvert b_i-\frac{p_{ik}}{q_k}\right\rvert\le\frac{1}{q_kk^{1/n}}.$$ This yields \begin{align} \left\lvert g\left(\pi q_k\right)\right\rvert&=\left\lvert \sum_{i=1}^n\frac{a_i}{b_i}\sin\left(b_i\pi q_k\right)\right\vert\\ &\le\sum_{i=1}^n\frac{a_i}{b_i}\left\lvert\sin\left(b_i\pi q_k\right)\right\rvert\\ &=\sum_{i=1}^n\frac{a_i}{b_i}\left\lvert\sin\left(\left(\frac{p_{ik}}{q_k}+\left(b_i-\frac{p_{ik}}{q_k}\right)\right)\pi q_k\right)\right\rvert\\ &=\sum_{i=1}^n\frac{a_i}{b_i}\left\lvert\sin\left(p_{ik}\pi\right)\cos\left(\left(b_i-\frac{p_{ik}}{q_k}\right)\pi q_k\right)+\sin\left(\left(b_i-\frac{p_{ik}}{q_k}\right)\pi q_k\right)\cos\left(p_{ik}\pi\right)\right\rvert\\ &=\sum_{i=1}^n\frac{a_i}{b_i}\left\lvert\sin\left(\left(b_i-\frac{p_{ik}}{q_k}\right)\pi q_k\right)\right\rvert\\ &\le\sum_{i=1}^n\frac{a_i}{b_i}\left\lvert\left(b_i-\frac{p_{ik}}{q_k}\right)\pi q_k\right\rvert\\ &\le\sum_{i=1}^n\frac{a_i}{b_i}\frac{\pi}{k^{1/n}}\rightarrow0. \end{align} Now pick $j\in\{1,...n\}$ such that $b_j=\max\{b_i\colon i=1,...,n\}$ and let $$m\colon=g\left(\frac{\pi}{b_j}\right)=\sum_{i=1}^n\frac{a_i}{b_i}\underbrace{\sin\left(\frac{b_i}{b_j}\pi\right)}_{>0}>0.$$ Thus we have $g\left(\frac{\pi}{b_j}\right)=m>0=g\left(0\right)$ and, by the Intermediate Value Theorem, there is a $x_0\in\left(0,\frac{\pi}{b_j}\right)$, such that $g\left(x_0\right)=m/2$. Since $\left\lvert g\left(\pi q_k\right)\right\vert\rightarrow0$, there exists a $K_1\in\mathbb{N}$ such that $\left\lvert g\left(\pi q_k\right)\right\vert<m/2$ for all $k\ge K_1$. Now the sequence $\left(q_k\right)_k$ must be unbounded, for otherwise, as it is an integer sequence, it would have a constant subsequence $\left(q\right)_l=\left(q_{k_l}\right)_l$. This would imply $\left\lvert b_iq-p_{ik_l}\right\rvert\le k_l^{-1/n}$, hence $\left\lvert b_iq-p_{ik_l}\right\rvert\rightarrow0$ and $p_{ik_l}\rightarrow b_iq$ for all $i=1,..,n$. However, $\left(p_{ik_l}\right)_l$ is an integer sequence, hence it's limit is integer in contradiction to the assumption that at least one $b_i$ is irrational. Thus, we can find an integer $K\ge K_1$, such that $q_K>b_j^{-1}$. This means $$g\left(\frac{\pi}{b_j}\right)=m>\frac{m}{2}>\left\lvert g\left(\pi q_K\right)\right\rvert\ge g\left(\pi q_K\right)\text{ and }\pi q_K>\frac{\pi}{b_j}.$$ By another application of the Intermediate Value Theorem, there is a $x_1\in\left(\frac{\pi}{b_j},\pi q_K\right)$, such that $g\left(x_1\right)=m/2$. Clearly, $x_0\neq x_1$, hence, by Rolle's theorem, there is a $\xi\in\left(x_0,x_1\right)$, such that $$f\left(\xi\right)=g^\prime\left(\xi\right)=0.$$ In either case, $f$ has a zero.