a) \(=x\left(x-y\right)+\left(x-y\right)=\left(x-y\right)\left(x+1\right)\)
b) \(=a^2\left(a-x\right)-y\left(a-x\right)=\left(a-x\right)\left(a^2-y\right)\)
c) \(=3\left(x^2+4x+4\right)=3\left(x+2\right)^2\)
d) \(=2\left(a^2-b^2\right)-5\left(a-b\right)=2\left(a-b\right)\left(a+b\right)-5\left(a-b\right)\)
\(=\left(a-b\right)\left(2a+2b+5\right)\)
e) \(=xy\left(x-y\right)-3\left(x^2-y^2\right)=xy\left(x-y\right)-3\left(x-y\right)\left(x+y\right)\)
\(=\left(x-y\right)\left(xy-3x-3y\right)\)
f) \(=x^2\left(x+5\right)-4\left(x+5\right)=\left(x+5\right)\left(x^2-4\right)\)
\(=\left(x+5\right)\left(x-2\right)\left(x+2\right)\)