$$3\cdot\exp\left(-\mathbf{j}r\dfrac{2\pi}5(-2)\right) + 3\cdot\exp\left(-\mathbf{j}r\dfrac{2\pi}5(2)\right)$$
This expression is transformed into $6\cos(4\pi r/5)$.
So my question is how was this done? I thought perhaps it was some variation of Euler's or something like that, but I was unable to find anything. Also, if the equation instead were a subtraction, would I get $6\sin(4\pi r/5)$?
Hint:
$e^{ix}=\cos x+i\sin x$, and $e^{-ix}=\cos(-x)+i\sin(-x)=\cos x-i\sin x$,
so $ {e^{ix}+e^{-ix}}=2\cos x$ and $ {e^{ix}-e^{-ix}}={2\color{blue}i\sin x}$.