[tex]\begin{gathered} x^3+x^2-22x-40=(x+2)(x+4)(x-5) \\ (x+2)(x+4)=x^2+4x+2x+8=x^2+6x+8 \\ (x^2+6x+8)(x-5)=x^3-5x^2+6x^2-30x+8x-40=x^3-x^2-22x-40 \\ x^3+x^2-22x-40=(x+2)(x+4)(x-5)\text{ is true} \\ \text{For the roots} \\ (x+2)(x+4)(x-5)=0 \\ x+2=0 \\ x=-2 \\ x+4=0 \\ x=-4 \\ x-5=0 \\ x=5 \\ \text{The roots are -2,-4 and 5} \end{gathered}[/tex]