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