Lời giải:
PT $\Leftrightarrow 4x^2+4x+1=3(x^2-4)+18$
$\Leftrightarrow 4x^2+4x+1=3x^2+6$
$\Leftrightarrow x^2+4x-5=0$
$\Leftrightarrow (x-1)(x+5)=0$
$\Leftrightarrow x-1=0$ hoặc $x+5=0$
$\Leftrightarrow x=1$ hoặc $x=-5$
\(\left(2x+1\right)^2=3\left(x-2\right)\left(x+2\right)+18\)
\(\Leftrightarrow4x^2+4x+1=3\left(x^2-4\right)+18\)
\(\Leftrightarrow4x^2+4x+1=3x^2-12+18\)
\(\Leftrightarrow4x^2+4x+1=3x^2+6\)
\(\Leftrightarrow4x^2-3x^2+4x=6-1\)
\(\Leftrightarrow x^2+4x=5\)
\(\Leftrightarrow x^2+4x-5=0\)
\(\Leftrightarrow x^2+5x-x-5=0\)
\(\Leftrightarrow x\left(x+5\right)-\left(x+5\right)=0\)
\(\Leftrightarrow\left(x+5\right)\left(x-1\right)=0\)
\(\Leftrightarrow\left[{}\begin{matrix}x=-5\\x=1\end{matrix}\right.\)
Vậy: \(S=\left\{-5;1\right\}\)