a: ĐKXĐ: \(x\notin\left\{3;-3\right\}\)
\(M=\left(\dfrac{x+3}{x-3}-\dfrac{18}{\left(x-3\right)\left(x+3\right)}+\dfrac{x-3}{x+3}\right):\dfrac{x+3-x-1}{x+3}\)
\(=\dfrac{x^2+6x+9-18+x^2-6x+9}{\left(x-3\right)\left(x+3\right)}\cdot\dfrac{x+3}{2}\)
\(=\dfrac{2x^2}{x-3}\cdot\dfrac{1}{2}=\dfrac{x^2}{x-3}\)
b: Để M nguyên thì \(x^2-9+9⋮x-3\)
\(\Leftrightarrow x-3\in\left\{1;-1;3;-3;9;-9\right\}\)
hay \(x\in\left\{4;2;6;0;12;-6\right\}\)