To find maxima or minima, let us differentiate the function. ‌f′(x)=−3x2+6x=0 ‌⇒x=0,2 At x=2, the function is maximum, and its value is 5 . Hence it is bigger than the value of cos‌x and e−x. But the graph of cubic function can achieve even bigger values at negative values of x, for example f(−2)=21, hence at x=2, the function achieves only the local maxima.