a) \(x^3+x^2+5x^2+5x+6x+6=x^2\left(x+1\right)+5x\left(x+1\right)+6\left(x+1\right)\)
\(=\left(x+1\right)\left(x^2+5x+6\right)=\left(x+1\right)\left(x+2\right)\left(x+3\right)\)
b) \(x^3-3x^2+9x^2-27x+14x-42\)
\(=x^2\left(x+3\right)+9x\left(x+3\right)+14\left(x+3\right)\)
\(=\left(x^2+9x+14\right)\left(x+3\right)\)
\(=\left(x+3\right)\left(x+2\right)\left(x+7\right)\)
c) \(\left(x^2+x+4\right)^2+3x\left(x^2+x+4\right)+5x\left(x^2+x+4\right)+15x^2\)
\(=\left(x^2+x+4\right)\left(x^2+x+4+3x\right)+5x\left(x^2+x+4+3x\right)\)
\(=\left(x^2+6x+4\right)\left(x^2+4x+4\right)\)
\(=\left(x^2+6x+4\right)\left(x+2\right)^2\)
d) \(\left(x+2\right)\left(x+8\right)\left(x+4\right)\left(x+6\right)+16\)
\(=\left(x^2+10x+16\right)\left(x^2+10x+24\right)+16\)
\(=\left(x^2+10x\right)^2+40\left(x^2+10x\right)+16.24+16\)
\(=\left(x^2+10x\right)^2+40\left(x^2+10x\right)+400\)
\(=\left(x^2+10x+20\right)^2\)