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