\(P=\frac{3x^2+3}{3\left(x^2-x+1\right)}=\frac{2\left(x^2-x+1\right)+x^2+2x+1}{3\left(x^2-x+1\right)}=\frac{2}{3}+\frac{\left(x+1\right)^2}{3\left(x^2-x+1\right)}\ge\frac{2}{3}\)
\(P_{min}=\frac{2}{3}\) khi \(x=-1\)
\(P=\frac{2\left(x^2-x+1\right)-x^2+2x-1}{x^2-x+1}=2-\frac{\left(x-1\right)^2}{x^2-x+1}\le2\)
\(P_{max}=2\) khi \(x=1\)