\(A=-x^2+2x-1+5=-\left(x^2-2x+1\right)+5=-\left(x-1\right)^2+5\\ \left(x-1\right)^2\ge0\Rightarrow A=-\left(x-1\right)^2+5\le5\)
Dấu "$=$" khi $x-1=0\Rightarrow x=1$
\(B=-2x^2+8x-8-7=-2\left(x^2-4x+4\right)-7=-2\left(x-2\right)^2-7\\ \left(x-2\right)^2\ge0\Rightarrow B=-2\left(x-2\right)^2-7\le7\)
Dấu "$=$" khi $x-2=0\Rightarrow x=2$