`(x-2)(x^2+3x-2)=x^3-8`
`⇔(x-2)(x^2+3x-2)=(x-2)(x^2+2x+4)`
`⇔(x-2)(x^2+3x-2)-(x-2)(x^2+2x+4)=0`
`⇔(x-2)(x^2+3x-2-x^2-2x-4)=0`
`⇔(x-2)(x-6)=0`
⇔\(\left[ \begin{array}{l}x-2=0\\x-6=0\end{array} \right.\)
⇔\(\left[ \begin{array}{l}x=2\\x=6\end{array} \right.\)
`Vậy S={2;6}`