\(P\left(x\right)=2x^4-7x^3-2x^2+13x+6\)
\(=2x^4-4x^3-3x^3+6x^2-8x^2+16x-3x+6\)
\(=2x^3\left(x-2\right)-3x^2\left(x-2\right)-8x\left(x-2\right)-3\left(x-2\right)\)
\(=\left(2x^3-3x^2-8x-3\right)\left(x-2\right)\)
\(=\left[2x^3-6x^2+3x^2-9x+x-3\right].\left(x-2\right)\)
\(=\left[2x^2\left(x-3\right)+3x\left(x-3\right)+x-3\right].\left(x-2\right)\)
\(=\left[\left(2x^2+3x+1\right)\left(x-3\right)\right]\left(x-2\right)\)
\(=\left(2x+1\right)\left(x+1\right)\left(x-3\right)\left(x-2\right)\)