\(3x\left(x-1\right)+\left(x+1\right)^2=1+3x^2\)
\(\Leftrightarrow3x^2-3x+x^2+2x+1=1+3x^2\)
\(\Leftrightarrow3x^2+x^2-3x^2-3x+2x+1-1=0\)
\(\Leftrightarrow x^2-x=0\)
\(\Leftrightarrow x\left(x-1\right)=0\)
\(\Leftrightarrow\left[{}\begin{matrix}x=0\\x-1=0\end{matrix}\right.\Leftrightarrow\left[{}\begin{matrix}x=0\\x=1\end{matrix}\right.\)
Vậy \(S=\left\{0;1\right\}\).
=>3x^2-3x+x^2+2x+1=3x^2+1
=>x^2-x=0
=>x=0; x=1