Mark M. answered 09/08/19
Retired math prof. Calc 1, 2 and AP Calculus tutoring experience.
The two pieces of the graph must fit together when x = 1 and the one-sided derivatives must agree
when x = 1.
So, 12 - 2(1) - a = -(1)2 + b + 2 and 2x - 2 = -2x + b when x = 1
We get: -1 - a = 1 + b and 0 = -2 + b
b = 2 and a = -4