\(M=\frac{2x+x^2-x^2+2-1}{x^2+2}=\frac{\left(x^2+2\right)-\left(x^2-2x+1\right)}{x^2+2}=1-\frac{\left(x-1\right)^2}{x^2+2}.\)
có \(-\left(x-1\right)^2\le0\)
\(x^2+2>0\)
Suy ra
\(-\frac{\left(x-1\right)^2}{x^2+2}\le0\)
vậy
\(M=1-\frac{\left(x-1\right)^2}{x^2+2}\le1\)
dấu = xảy ra khi \(\left(x-1\right)^2=0\Leftrightarrow x=1.\)