Ta có: \(3x+1⋮x+2\)
\(\Leftrightarrow3x+6-5⋮x+2\)
\(\Leftrightarrow-5⋮x+2\)
\(\Leftrightarrow x+2\inƯ\left(-5\right)\)
\(\Leftrightarrow x+2\in\left\{1;-1;5;-5\right\}\)
\(\Leftrightarrow x\in\left\{-1;-3;3;-7\right\}\)(tm)
Vậy: \(x\in\left\{-1;-3;3;-7\right\}\)