\(B=\dfrac{\left(x+4\right)\times x-2}{x+4}\)
\(B=x-\dfrac{2}{x+4}\)
Vì \(x\in z\), để \(B\in z\Leftrightarrow\dfrac{2}{x+4}\in z\)
\(\Leftrightarrow2⋮\left(x+4\right)\)
\(\Leftrightarrow x+4\inƯ\left(2\right)\)
Mà \(Ư\left(2\right)=\left(\pm1;\pm2\right)\)
Ta có bảng sau
\(\begin{matrix}x+4&1&-1&2&-2\\x&-3&-5&-2&-6\end{matrix}\)
Vậy \(x\in\left(-2;-3;-5;-6\right)\) thì \(B\in z\)