a) \(4x^2-8x+4-9\left(x-y\right)^2\)
\(=4\left(x^2-2x+1\right)-9\left(x-y\right)^2\)
\(=\left[2\left(x-1\right)\right]^2-\left[3\left(x-y\right)\right]^2\)
\(=\left(2x-2+3x-3y\right)\left(2x-2-3x+3y\right)\)
\(=\left(5x-3y-2\right)\left(3y-x-2\right)\)
b) \(x^3-4x^2+12x-27\)
\(=\left(x^3-27\right)-\left(4x^2-12x\right)\)
\(=\left(x-3\right)\left(x^2+3x+9\right)-4x\left(x-3\right)\)
\(=\left(x-3\right)\left(x^2-x+9\right)\)