Start with cosx+cosy. Make a substitution and let x=α+β and let y=α−β, so cosx+cosy becomes cos(α+β)+cos(α−β)=cosαcosβ−sinαsinβ+cosαcosβ+sinαsinβ=2cosαcosβ
Since x=α+β and y=α−β, we can solve for α and β in terms of x and y and substitute in for 2cosαcosβ and get 2cos(2x+y)cos(2x−y).