\(x^2\left(x+1\right)^2+x^2+\left(x+1\right)^2\)
\(=\left(x^2+1\right)\left(x+1\right)^2+x^2+1-1\)
\(=\left(x^2+1\right)\left[\left(x+1\right)^2+1\right]-1\)
\(=\left(x^2+1\right)\left(x^2+1+2x+1\right)-1\)
\(=\left(x^2+1\right)^2+2x\left(x^2+1\right)+x^2+1-1\)
\(=\left(x^2+1\right)^2+2x\left(x^2+1\right)+x^2\)
\(=\left(x^2+1+x\right)^2\)