a) \(x^3-2x^2+x-xy^2\)
= \(x\left(x^2-2x+1-y^2\right)\)
\(=x\left(x-1-y\right)\left(x-1+y\right)\)
b) \(x^3-4x^2-12x+27\)
\(=x^3+27-4x^2-12x\)
\(=\left(x+3\right)\left(x^2-3x+9\right)-4x\left(x+3\right)\)
\(=\left(x+3\right)\left(x^2-7x+9\right)\)
c) \(x^2-2xy+y^2+1\)
\(=\left(x-1\right)^2+1\)
d) \(2x^2+4x+2-2y^2\)
\(=2\left(x^2+2x+1-y^2\right)\)
\(=2\left(x+1+y\right)\left(x+1-y\right)\)
e) \(2xy-x^2-y^2+16\)
\(=-\left(x^2-2xy+y^2-4^2\right)\)
\(=-\left(x-y-4\right)\left(x-y+4\right)\)