\(=\frac{3\left(x^2+2x+3\right)+1}{\left(x^2+2x+3\right)}=3+\frac{1}{\left(x+1\right)^2+2}\). ta có: \(\left(x+1\right)^2\ge0\Leftrightarrow\left(x+1\right)^2+2\ge2\Leftrightarrow\frac{1}{\left(x+1\right)^2+2}\le\frac{1}{2}\Leftrightarrow3+\frac{1}{\left(x+1\right)^2+2}\le\frac{7}{2}\)
=> max M=7/2 <=> x=-1