\(B=2x-x^2+1\\ B=-x^2+2x-1+1+1\\ B=-\left(x^2-2x+1\right)+2\\ B=-\left(x-1\right)^2+2\)
Nhận xét:
\(\left(x-1\right)^2\ge0\\ \Rightarrow-\left(x-1\right)^2\le0\\ \Rightarrow B=-\left(x-1\right)^2+2\le2\\ Dấu"=".xảy.ra.khi\)
\(-\left(x-1\right)^2=0\\ \Rightarrow\left(x-1\right)^2=0\\ \Rightarrow x-1=0\\ \Rightarrow x=1\)
\(Vậy.MaxB=2.khi.x=1\)