\(x^3-4x-12+3x^2=x\left(x^2-2^2\right)+3\left(x^2-2^2\right)=\left(x-2\right)\left(x+2\right)\left(x+3\right)\)
\(x^2+2xy-15y^2=x^2+2xy+y^2-16y^2=\left(x+y\right)^2-\left(4y\right)^2=\left(x-3y\right)\left(x+5y\right)\)
\(\left(x-y\right)^2-6\left(x-y\right)-16=\left(x-y\right)^2-2\times\left(x-y\right)\times3+9-25=\left(x-y-3\right)^2-5^2=\left(x-y-8\right)\left(x-y+2\right)\)