Xét \(g\left(x\right)=\dfrac{2x^2+x-1}{x^2-x+1}\)
\(g\left(x\right)=\dfrac{3x^2-\left(x^2-x+1\right)}{x^2-x+1}=\dfrac{3x^2}{x^2-x+1}-1\ge-1\)
\(g\left(x\right)=\dfrac{3\left(x^2-x+1\right)-x^2+4x-4}{x^2-x+1}=3-\dfrac{\left(x-2\right)^2}{x^2-x+1}\le3\)
\(\Rightarrow-1\le g\left(x\right)\le3\Rightarrow0\le\left|g\left(x\right)\right|\le3\)
\(\Rightarrow y_{max}=3\) khi \(x=2\)