Ta có:
\(A=\dfrac{x^2-x+1}{x^2+x+1}\)
\(=\dfrac{3x^2+3x+3-\left(2x^2+4x+2\right)}{x^2+x+1}\)
\(=3-\dfrac{2\left(x^2+2x+1\right)}{x^2+x+1}\)
\(=3-\dfrac{2\left(x+1\right)^2}{x^2+x+1}\)
Ta thấy:
\(\dfrac{2\left(x+1\right)^2}{x^2+x+1}\ge0\forall x\)
\(\Rightarrow3-\dfrac{2\left(x+1\right)^2}{x^2+x+1}\le3\forall x\)
hay \(A\le3\)
=> Max A = 3
Dấu \("="\) xảy ra khi và chỉ khi \(2\left(x+1\right)^2=0\)
\(\Leftrightarrow x=-1\)
Lại có:
\(A=\dfrac{x^2-x+1}{x^2+x+1}\)
\(=\dfrac{3x^2-3x+3}{3x^2+3x+3}\)
\(=\dfrac{x^2+x+1+2x^2-4x+2}{3\left(x^2+x+1\right)}\)
\(=\dfrac{1}{3}+\dfrac{2x^2-4x+2}{3\left(x^2+x+1\right)}\)
\(=\dfrac{1}{3}+\dfrac{2\left(x-1\right)^2}{3\left(x^2+x+1\right)}\)
Ta thấy :
\(\dfrac{2\left(x-1\right)^2}{3\left(x^2+x+1\right)}\ge0\forall x\)
\(\Rightarrow\dfrac{1}{3}+\dfrac{2\left(x-1\right)^2}{3\left(x^2+x+1\right)}\ge\dfrac{1}{3}\forall x\)
=> Min A = \(\dfrac{1}{3}\)
Dấu \("="\) xảy ra khi và chỉ khi \(2\left(x-1\right)^2=0\)
\(\Leftrightarrow x=1\)
Vậy Min A = \(\dfrac{1}{3}\) tại x = 1 Max A = 3 tại x = 1