The function f (x) = - x2 + 2aX + 1-A has the maximum value 2 in the interval [0,1]. Find the value of real number a

The function f (x) = - x2 + 2aX + 1-A has the maximum value 2 in the interval [0,1]. Find the value of real number a

When a < 0, [0,1] is the decreasing interval of F (x), f (x) max = f (0) = 1-A = 2 〈 a = - 1; when a > 1, [0,1] is the increasing interval of F (x), f (x) max = f (1) = a = 2 〉 a = 2; when 0 ≤ a ≤ 1, f (x) max = f (a) = a2-a + 1 = 2, the solution is a = 1 ± 52, which is the same as 0