a.
\(=x^4-4x^3+4x^2+4\left(x^2-4x+4\right)\)
\(=x^2\left(x^2-4x+4\right)+4\left(x^2-4x+4\right)\)
\(=\left(x-2\right)^2\left(x^2+4\right)\)
b.
\(=\left(xy+4\right)^2-\left(2x+2y\right)^2\)
\(=\left(xy+4-2x-2y\right)\left(xy+4+2x+2y\right)\)
\(=\left(x-2\right)\left(y-2\right)\left(x+2\right)\left(y+2\right)\)