Use the binomial theorem as follows:

Now we can use Euler to say that this equals

which we can break up as

Since the original LHS equals this last expression, we can say that the imaginary part of the RHS must vanish, since the LHS is real. That is, we can say that

You're almost there now. All you need do to finish is to note that the cosine function is even. That means some of the terms in the sum can be rewritten in terms of positive multiples of inside the argument. Moreover, the constant term, if there is one (which will happen precisely when is even), you can take out of the sum, if you wish, and include in the multiple of .

Does this help?