\(P\left(x\right)=x^4-x^3+3x^3-3x^2-10x^2+10x-24x+24\)
\(=x^3\left(x-1\right)+3x^2\left(x-1\right)-10x\left(x-1\right)-24\left(x-1\right)\)
\(=\left(x-1\right)\left(x^3+3x^2-10x-24\right)\)
\(=\left(x-1\right)\left(x^3+2x^2+x^2+2x-12x-24\right)\)
\(=\left(x-1\right)\left(x+2\right)\left(x^2+x-12\right)\)
\(=\left(x-1\right)\left(x+2\right)\left(x-3\right)\left(x+4\right)\)