DFT of cosine

This should be done by hand, and the solution will reduce to a very simple form.

2. Relevant equations

3. The attempt at a solution

I slaved through this problem and got an answer that seems to have the same shape and magnitude as the dft function in MATLAB, but it is not what I'd consider a "very simple form." Could you please check my work and see if there is any major simplifications I missed?

where x(k) is the frequency values at normalized frequency k, x(n) is the input sample, and N is the number of samples taken. For this problem, this formula is:
[tex]
\tilde{f(k)} = \sum_{n=0}^{M-1} cos(2 \pi f_x n) e^{\frac{-j 2 \pi k n}{M}}
[/tex]