Bài 1:
Để B nguyên thì \(3x+1⋮x-1\)
\(\Leftrightarrow x-1\inƯ\left(4\right)\)
\(\Leftrightarrow x-1\in\left\{1;-1;2;-2;4;-4\right\}\)
hay \(x\in\left\{2;0;3;-1;5;-3\right\}\)
Bài 2:
a: Ta có: \(P=\dfrac{x^2-9}{x^2-6x+9}\)
\(=\dfrac{\left(x-3\right)\left(x+3\right)}{\left(x-3\right)^2}\)
\(=\dfrac{x+3}{x-3}\)
b: Để P nguyên thì \(x+3⋮x-3\)
\(\Leftrightarrow x-3\in\left\{1;-1;2;-2;3;-3;6;-6\right\}\)
hay \(x\in\left\{4;2;5;1;6;0;9;-3\right\}\)