\(\left(x^2+3x+1\right)\left(x^2+3x-3\right)-5\)
\(=\left(x^2+3x\right)^2-2\left(x^2+3x\right)-3-5\)
\(=\left(x^2+3x\right)^2-2\left(x^2+3x\right)-8\)
\(=\left(x^2+3x-4\right)\left(x^2+3x+2\right)\)
\(=\left(x+4\right)\left(x-1\right)\left(x+1\right)\left(x+2\right)\)
\(\left(x^2+4x+8\right)^2+3x^3+14x^2+24x\)
\(=\left(x^2+4x+8\right)^2+3x^3+12x^2+24x+2x^2\)
\(=\left(x^2+4x+8\right)^2+3x\left(x^2+4x+8\right)+2x^2\)
\(=\left(x^2+4x+8+x\right)\left(x^2+4x+8+2x\right)\)
\(=\left(x^2+5x+8\right)\left(x+2\right)\left(x+4\right)\)
\(\left(x^2+3x-4\right)\left(x^2+x-6\right)-24\)
\(=\left(x+4\right)\left(x-1\right)\left(x+3\right)\left(x-2\right)-24\)
\(=\left(x^2+2x-8\right)\left(x^2+2x-3\right)-24\)
\(=\left(x^2+2x\right)^2-11\left(x^2+2x\right)+24-24\)
\(=\left(x^2+2x\right)^2-11\left(x^2+2x\right)\)
\(=\left(x^2+2x\right)\left(x^2+2x-11\right)\)