Ta có: \(B=-x^2-2x+2\)
\(\Rightarrow BMax\Leftrightarrow-x^2-2x+2Max\)
\(\Leftrightarrow-\left(x^2+2x-2\right)Max\)
\(\Leftrightarrow-\left(x^2+2x+1-3\right)Max\)
\(\Leftrightarrow-\left[\left(x+1\right)^2-3\right]Max\)
\(\Leftrightarrow-\left(x+1\right)^2+3Max\)
Vì \(-\left(x+1\right)^2\le0\forall x\)
\(\Rightarrow-\left(x+1\right)^2+3\le3\forall x\)
Dấu = xảy ra \(\Leftrightarrow x+1=0\)
\(\Leftrightarrow x=-1\)
\(\Rightarrow MaxB=3\Leftrightarrow x=-1\)