Use integration by parts
#\intu \quad dv=uv-intv du#
Let #u=x#, #\quad \implies du=dx#
and let #\quad \quaddv=cos(2x)dx#, #\implies v=1/2sin(2x)#
Now integrate by parts
#intxcos(2x)dx=intu\quaddv=uv-intvdu#
#\quad \quad \quad \quad \quad \quad \quad \quad\quad \quad \quad \quad\quad \quad \quad \quad\quad \quad \quad \quad =x*1/2sin(2x)-int1/2sin(2x)dx#
#\quad \quad \quad \quad \quad \quad \quad \quad\quad \quad \quad \quad\quad \quad \quad \quad\quad \quad \quad \quad =x/2sin(2x)+1/4cos(2x)+C#
where #C# is the constant of integration.
Quick note on how to get integration by parts formula:
The differential of #uv# is
#d[uv]=udv+vdu#
#udv=d[uv]-vdu#
Integrate both sides
#\int udv=int d[uv]-int vdu#
#\int u dv=uv-intvdu#