\(\frac{x^2+x+1}{x^2+2x+1}=1-\frac{x}{\left(x+1\right)^2}\)
\(=1-\frac{1}{x+1}+\frac{1}{\left(x+1\right)^2}=\left[\frac{1}{4}-\frac{1}{x+1}+\frac{1}{\left(x+1\right)^2}\right]+\frac{3}{4}\)
\(=\left(\frac{1}{2}-\frac{1}{x+1}\right)^2+\frac{3}{4}\ge\frac{3}{4}\)
\(\Rightarrow P\ge\frac{3}{4}\)
Vậy \(Max_P=\frac{3}{4}\Leftrightarrow x=1\)