a) Với \(x\in\left\{0;3\right\}\), ta có:
\(B=\left(\frac{x-3}{x}-\frac{x}{x-3}+\frac{9}{x^2-3x}\right):\frac{2x-2}{x}\)
\(=\left[\frac{x-3}{x}-\frac{x}{x-3}+\frac{9}{x\left(x-3\right)}\right]:\frac{2\left(x-1\right)}{x}\)
\(=\frac{\left(x-3\right)^2-x^2+9}{x\left(x-3\right)}.\frac{x}{2\left(x-1\right)}\)
\(=\frac{\left(x-3\right)^2-\left(x-3\right)\left(x+3\right)}{x\left(x-3\right)}.\frac{x}{2\left(x-1\right)}\)
\(=\frac{\left(x-3\right)\left[\left(x-3\right)-\left(x+3\right)\right]}{x\left(x-3\right)}.\frac{x}{2\left(x-1\right)}\)
\(=\frac{-6\left(x-3\right)}{x\left(x-3\right)}.\frac{x}{2\left(x-1\right)}\)
\(=\frac{-6x\left(x-3\right)}{2x\left(x-3\right)\left(x-1\right)}=\frac{-3}{x-1}\)
b) Để B luôn nhận giá trị nguyên thì \(-3⋮\left(x-1\right)\) với \(x\notin\left\{0;3\right\}\)
Hay \(3⋮\left(x-1\right)\)
\(\Rightarrow x-1\inƯ\left(3\right)=\left\{\pm1;\pm3\right\}\)
TH1: \(x-1=\pm1\Leftrightarrow\left[{}\begin{matrix}x-1=1\\x-1=-1\end{matrix}\right.\Leftrightarrow\left[{}\begin{matrix}x=2\\x=0\end{matrix}\right.\)
TH2: \(x-1=\pm3\Leftrightarrow\left[{}\begin{matrix}x-1=3\\x-1=-3\end{matrix}\right.\Leftrightarrow\left[{}\begin{matrix}x=4\\x=-2\end{matrix}\right.\)
Ta lấy \(x\in\left\{-2;2;4\right\}\) (vì \(x\ne0\))
Vậy \(x\in\left\{-2;2;4\right\}\)