Let a1,a2,,ana_1, a_2, \cdots, a_n be real constants, xx a real variable, and

f(x)=cos(a1+x)+12cos(a2+x)+14cos(a3+x)++12n1cos(an+x).f(x) = \cos(a_1 + x) + \frac{1}{2}\cos(a_2 + x) + \frac{1}{4}\cos(a_3 + x) + \cdots + \frac{1}{2^{n-1}}\cos(a_n + x).

Given that f(x1)=f(x2)=0f(x_1) = f(x_2) = 0, prove that x2x1=mπx_2 - x_1 = m\pi for some integer mm.