I got expressions that look like $$ \frac{1}{2} \mathrm e^{-\mathrm i r x} \left[\mathrm e^{2\mathrm i r x} \left(1 + \mathrm e^{-2\mathrm i x}\right)^r + \left(1 + \mathrm e^{2\mathrm i x}\right)^r\right] $$ and I want Mathematica to return $ 2^r\cos^rx $.
I tried Assumptions -> x > 0 && r > 0
and other things but nothing seems to give me this obvious answer.
$x$ is a real number and $r$ is an integer.