You can also determine the maximum without resorting to Calculus.
y = -x2+2x+2 is a quadratic function. The graph of a quadratic function is a parabola.
In general, for y = Ax2+Bx+C, if A < 0, then the graph is a parabola opening downward with maximum value when x = -B/(2A).
For the given quadratic function, the maximum occurs when
x = -2/(2(-1)) = 1
Maximum value = f(1) = -(1)2+2(1)+2 = 3