expand trig cos(k x) cos(x)