Prove that $a_1 \cos(b_1 x) + \dots + a_n \cos(b_n x)$ has zero Given is function 
$$f(x)=a_1 \cos(b_1 x) + \dots + a_n \cos(b_n x) $$
where $\forall_{i} a_i > 0 $ and$\forall_{i} b_i > 0 $
Prove that $$\exists_{x_0} f(x_0) = 0 $$
My try
My plan:
1. Find a function $g$ such that $g' = f$
2. Prove that $\exists_{x_1, x_2} g(x_1) = g(x_2) = 0 $

3. From Rolle's theorem it follows that $$\exists_{c \in (x_1,x_2)} g'(c)=f(c)=0$$
1.
$$g(x) = \frac{a_1}{b_1} \sin(b_1 x) + \dots + \frac{a_n}{b_n} \sin(b_n x)  $$
2.
Without lost of generality:
$$b_1 \ge \dots \ge b_n$$
First zero is just $g(0) = 0$ 
But what about second 0? I think that I can find two arguments such that $g(arg_1) >0$ $g(arg_2) < 0$ and use Darboux theorem. 
arg1
$$ g(\frac{\pi}{b_1}) = \frac{a_1}{b_1} \sin(\frac{b_1 \cdot\pi}{b_1}) + \dots + \frac{a_n}{b_n} \sin(\frac{b_n \cdot\pi}{b_1}) $$
each argument is between $ 0 $ and $\pi$ so it will be greater than $0$
stuck
But I can't find second argument...
 A: As noted above it is enough to prove that $g$ is not monotonic, hence not 1-1; assume as above $b_1 \ge \dots \ge b_n >0$, then  $g(0)=0, g(x)=-g(-x)$ and also $g(\frac{\pi}{2b_1}) \geq \frac{a_1}{b_1}$ since all the remaining terms are positive as $b_1$ is highest so $\sin(b_kx) \geq 0, 0 < x \leq \frac{\pi}{2b_1}$. 
Let $M>0$ s.t $ \frac{a_k}{b_k} \leq M$ for all $k=1,..n$,let $N >4$ high enough integer s.t. $\frac{\pi Mn}{N} < \frac{a_1}{b_1}$, and let $c=\frac{\pi}{2b_1}+1$ Using Dirichlet theorem we can find $c \leq x_0 \leq cN^n$ s.t. $||\frac{b_kx_0}{\pi}|| \leq \frac{1}{N}$ for all $k=1,...n$, where as usual $||a|| = \min_{k \in \mathbb{Z}}|a-k|$ is the minimum distance from $a$ to the integers.
But now $|b_kx_0-\pi m_k| \leq \frac{\pi}{N}$ for some integer $m_k$, means $|\sin(b_kx_0)|=|\sin(b_kx_0-\pi m_k)| \leq \sin{\frac{\pi}{N}} \leq \frac{\pi}{N}$, so $|g(x_0)| \leq \frac{\pi Mn}{N}  < \frac{a_1}{b_1} < g(\frac{\pi}{2b_1})$ by our choice above, but $x_0 \geq c > \frac{\pi}{2b_1}$, so $g$ cannot be increasing, hence cannot be monotonic, so we are done by Rolle's Theorem
A: 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.
A: You are almost there. One more hint: you don't really need $g(x_1)=g(x_2)=0$. $g(x_1)=g(x_2)$ for distinct $x_1,x_2$ is sufficient to say the result. And I think what to show is that $g$ is not monotonic. In that way, you will have such $x_1$ and $x_2$.
