Find the maximum value of the quadratic function y = - X's Square - 4x + 4 in - t greater than or equal to x less than or equal to - t + 2 (t is a constant)

Find the maximum value of the quadratic function y = - X's Square - 4x + 4 in - t greater than or equal to x less than or equal to - t + 2 (t is a constant)


y=-x^2-4x+4=-(x^2+4x+4)+8=-(x+2)^2+8.
1. When - t + 2 = 4, the given domain is on the left side of the symmetry axis, and the maximum value is at x = - t + 2
f(x)max=f(2-t)=-(4-t)^2+8;
2. When - t