A=x^2+x-6
=x^2+2x.1/2+(1/2)^2-(1/2)^2-6
=(x+1/2)^2-25/4> hoặc bằng -25/4
vậy min A=-25/4 <=> x+1/2=0
<=> x=-1/2
B=x-x^2-1
=-(x^2-x+1)
=-[x^2-2x.1/2+(1/2)^2-(1/2)^2+1]
=-[(x-1/2)^2+3/4]
=-(x-1/2)^2-3/4 < hoặc bằng -3/4
vậy max B=-3/4 <=> -x+1/2=0
<=> x=1/2