\(a^2+2a\left(1+x\right)-8x-8=0\\ \Leftrightarrow a^2+2a\left(1+x\right)-8\left(x+1\right)=0\\ \Leftrightarrow\left(a^2+2a\right)-8\left(x+1\right)=0\\ \Leftrightarrow a\left(a+2\right)-8\left(x+1\right)=0\\ \Leftrightarrow\left(a-8\right)\left(a+2\right)\left(x+1\right)=0\\ \Leftrightarrow\left\{{}\begin{matrix}a-8=0\\a+2=0\\x+1=0\end{matrix}\right.\\ \Leftrightarrow\left\{{}\begin{matrix}a=8\\a=-2\\x=-1\end{matrix}\right.\)