\(B=-x^2+4x-\frac{1}{2}\)
\(\Leftrightarrow B=-\left(x^2-4x+\frac{1}{2}\right)\)
\(\Leftrightarrow B=-\left(x^2-4x+4-4+\frac{1}{2}\right)\)
\(\Leftrightarrow B=-\left(x-2\right)^2+\frac{7}{2}\)
Vì \(\left(x-2\right)^2\ge0\forall x\)
\(\Leftrightarrow-\left(x-2\right)^2\le0\forall x\)
\(\Leftrightarrow-\left(x-2\right)^2+\frac{7}{2}\le\frac{7}{2}\forall x\)
\(\Rightarrow Max_B=\frac{7}{2}\) khi x=2
\(B=-x^2+4x-\frac{1}{2}=-\left(x^2-4x+4\right)+\frac{7}{2}\)\(=-\left(x-2\right)^2+\frac{7}{2}\)
Vì \(-\left(x-2\right)^2\le0\Rightarrow B\le\frac{7}{2}\)
Dấu ''='' xảy ra \(\Leftrightarrow x=2\)
Vậy \(Max_B=\frac{7}{2}\Leftrightarrow x=2\)