\(\left(x+1\right)\left(x+2\right)\left(x+4\right)\left(x+5\right)=40\\ \Leftrightarrow\left(x+1\right)\left(x+5\right)\left(x+2\right)\left(x+4\right)=40\\ \Leftrightarrow\left(x^2+6x+5\right)\left(x^2+6x+8\right)=40\)
Đặt \(x^2+6x+5=t\)
\(\Rightarrow t\left(t+3\right)=40\\ \Rightarrow t^2+3t=40\\ \Rightarrow t^2+2.t.\dfrac{3}{2}+\dfrac{9}{4}=\dfrac{169}{4}\\ \Rightarrow\left(t+\dfrac{3}{2}\right)^2=\left(\dfrac{13}{2}\right)^2\\ \Leftrightarrow\left(t+\dfrac{3}{2}\right)^2-\left(\dfrac{13}{2}\right)^2=0\\ \Leftrightarrow\left(t+\dfrac{3}{2}-\dfrac{13}{2}\right)\left(t+\dfrac{3}{2}+\dfrac{13}{2}\right)=0\\ \Leftrightarrow\left(t-5\right)\left(t+8\right)=0\\ \Leftrightarrow\left[{}\begin{matrix}t=5\\t=-8\end{matrix}\right.\)
TH1: t=5
\(\Rightarrow x^2+6x+5=5\\ \Rightarrow x\left(x+6\right)=0\\ \Leftrightarrow\left[{}\begin{matrix}x=0\\x=-6\end{matrix}\right.\)
TH2 : t=-8
\(\Rightarrow x^2+6x+5=-8\\ \Rightarrow\left(x+3\right)^2=-4\left(voly\right)\)
=> x rông
Vậy x=0 hoặc x=-6
\(\left(x+1\right)\left(x+2\right)\left(x+4\right)\left(x+5\right)=40\)
\(\Rightarrow\left(x+1\right)\left(x+5\right)\left(x+2\right)\left(x+4\right)-40=0\)
\(\Rightarrow\left(x^2+6x+5\right)\left(x^2+6x+8\right)-40=0\)
Đặt \(a=x^2+6x+5\)
\(\Rightarrow a\left(a+3\right)-40=0\)
\(\Rightarrow a^2+3a-40=0\)
\(\Rightarrow a^2+8a-5a-40=0\)
\(\Rightarrow a\left(a+8\right)-5\left(a+8\right)=0\)
\(\Rightarrow\left(a+8\right)\left(a-5\right)=0\)
\(\Rightarrow\left[{}\begin{matrix}a+8=0\\a-5=0\end{matrix}\right.\)\(\Rightarrow\left[{}\begin{matrix}a=-8\\a=5\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}x^2+6x+5+8=0\\x^2+6x+5-5=0\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}x^2+6x+13=0\\x^2+6x=0\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}x^2+6x+13\ne0\\x\left(x+6\right)=0\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}x=0\\x=-6\end{matrix}\right.\)
Kết luận:\(S=\left\{-6;0\right\}\)