g: \(\Leftrightarrow\left(x^2+6x+5\right)\left(x^2+6x+8\right)-4=0\)
\(\Leftrightarrow\left(x^2+6x\right)^2+13\left(x^2+6x\right)+36=0\)
\(\Leftrightarrow\left(x+3\right)^2\left(x^2+6x+4\right)=0\)
\(\Leftrightarrow\left[{}\begin{matrix}x=-3\\x=\sqrt{5}-3\\x=-\sqrt{5}-3\end{matrix}\right.\)