Calculate the first derivative
#y=x-2cosx#
#dy/dx=1+2sinx#
The critical points are when
#dy/dx=0#
#1+2sinx=0#
#sinx=-1/2#
#x in (-1/6pi+2kpi) uu (7/6pi+2kpi)#, #AA k in ZZ#
We build a sign chart in the interval # x in [-1/6pi, 19/6pi]#
#color(white)(aaaa)##x##color(white)(aaaa)##-1/6pi##color(white)(aaaaaaa)##7/6pi##color(white)(aaaaa)##11/6pi##color(white)(aaaa)##19/6pi#
#color(white)(aaaa)##dy/dx##color(white)(aaaaa)##0##color(white)(aaaa)##+##color(white)(aa)##0##color(white)(aaa)##-##color(white)(aa)##0##color(white)(aaaa)##+#
#color(white)(aaaa)##y##color(white)(aaaaaaa)####color(white)(aaaa)##↗##color(white)(aa)####color(white)(aaa)##↘##color(white)(aa)####color(white)(aaaa)##↗#
Therefore,
The intervals of increasing are #(-1/6pi+2kpi, 7/6pi+2kpi)#
The intervals of decreasing are #(7/6pi+2kpi, 11/6pi+2kpi)#
#AA k in ZZ#
graph{x-2cosx [-14.95, 17.09, -4.82, 11.2]}