a: ĐKXĐ: \(x\in R\)
\(\sqrt{x^2+6x+9}=2x+1\)
=>\(\left|x+3\right|=2x+1\)
=>\(\left\{{}\begin{matrix}x>=-\dfrac{1}{2}\\\left(2x+1\right)^2=\left(x+3\right)^2\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}x>=-\dfrac{1}{2}\\\left(2x+1-x-3\right)\left(2x+1+x+3\right)=0\end{matrix}\right.\)
=>\(\left\{{}\begin{matrix}x>=-\dfrac{1}{2}\\\left(x-2\right)\left(3x+4\right)=0\end{matrix}\right.\Leftrightarrow x=2\)
\(\sqrt{x^2+6x+9}=2x-1\\ \Leftrightarrow\sqrt{\left(x+3\right)^2}=2x-1\\ \Leftrightarrow\left|x+3\right|=2x-1\\ TH_1:x\ge-3\\ x+3=2x-1\Leftrightarrow-x=-4\Leftrightarrow x=4\left(tm\right)\\ TH_2:x< -3\\ -x-3=2x-1\Leftrightarrow-3x=2\Leftrightarrow x=-\dfrac{2}{3}\left(tm\right)\)
Vậy \(S=\left\{-\dfrac{2}{3};4\right\}\)