\(B=4x-x^2-7=-\left(x^2-4x+7\right)\)
\(=-\left(x^2-2.x.2+2^2-4+7\right)\)
\(=-\left[\left(x-2\right)^2+3\right]\)
\(=-\left(x-2\right)^2-3\)
Do \(-\left(x-2\right)^2\le0\) với mọi x (dấu "=" xảy ra \(\Leftrightarrow x=2\))
\(\Rightarrow-\left(x-2\right)^2-3\le-3\) hay \(B\le-3\) (dấu "=" xảy ra \(\Leftrightarrow x=2\))
Vậy \(B_{max}=-3\) tại \(x=2\)