x+y=3=>x=3-y
M=x+xy+y=x+y+xy=3-y+y+(3-y).y
=3+3y-y2=-y2+3y+3=-(y2-3y-3)=\(-\left(y^2-2.y.\frac{3}{2}+\frac{9}{4}-\frac{9}{4}-3\right)=-\left[\left(y-\frac{3}{2}\right)^2-\frac{21}{4}\right]=\frac{21}{4}-\left(y-\frac{3}{2}\right)^2\le\frac{21}{4}\) (với mọi y)
Dấu "=" xảy ra <=> y=3/2 <=> x=3/2
Vậy M đạt GTLN là 21/4 khi x=y=3/2