a) \(x^4+x^3+x+1\)
\(=x^3\left(x+1\right)+\left(x+1\right)\)
\(=\left(x+1\right)\left(x^3+1\right)\)
\(=\left(x+1\right)^2\left(x^2-x+1\right)\)
b) \(x^4-x^3-x^2+1\)
\(=x^3\left(x-1\right)-\left(x^2-1\right)\)
\(=x^3\left(x-1\right)-\left(x+1\right)\left(x-1\right)\)
\(=\left(x-1\right)\left(x^3-x-1\right)\)
c) \(\left(2x+1\right)^2-\left(x-1\right)^2\)
\(=\left(2x+1+x-1\right)\left(2x+1-x+1\right)\)
\(=3x\left(x+2\right)\)
d) \(x^4+4x^2-5\)
\(=\left(x^4+4x^2+4\right)-9\)
\(=\left(x^2+2\right)^2-9\)
\(=\left(x^2+5\right)\left(x^2-1\right)\)
\(=\left(x^2+5\right)\left(x+1\right)\left(x-1\right)\)