a) \(2x^3+x^2-4x-12\)
\(=2x^3-4x^2+5x^2-10x+6x-12\)
\(=2x^2\left(x-2\right)+5x\left(x-2\right)+6\left(x-2\right)\)
\(=\left(x-2\right)\left(2x^2+5x+6\right)\)
b) \(5x^2+6xy+y^2\)
\(=5x^2+5xy+xy+y^2\)
\(=5x\left(x+y\right)+y\left(x+y\right)\)
\(=\left(x+y\right)\left(5x+y\right)\)