f(x) = -x^2 + 2ax + 1 - a
f'(x) = -2x + 2a = 2(a-x)
若a <= 0, 在区间「0,1」上,f'(x) <= 0,f(x)=-x^2+2ax+1-a在区间「0,1」上单调递减,2=f(0) = 1-a, a = -1.
若a >= 1,在区间「0,1」上f'(x)>=0, f(x)=-x^2+2ax+1-a在区间「0,1」上单调递增,2 = f(1) = a, a = 2.
若0=0, f(x)=-x^2+2ax+1-a在区间「0,a」上单调递增.
在区间「a,1」上f'(x)<=0, f(x)=-x^2+2ax+1-a在区间「a,1」上单调递减.
2 = f(a) = a^2 + 1 - a,
a^2 - a - 1 = 0,
a(a-1) = 1,
但 0
综合,有,
a = -1,或者,a = 2.