\(B=x-x^2=-\left(x^2-x+\frac{1}{4}\right)+\frac{1}{4}=-\left(x-\frac{1}{2}\right)^2+\frac{1}{4}\)
Vì: \(-\left(x-\frac{1}{2}\right)^2\le0\)
=> \(-\left(x-\frac{1}{2}\right)^2+\frac{1}{4}\le\frac{1}{4}\)
Vậy GTLN của B là \(\frac{1}{4}\) khi \(x=\frac{1}{2}\)