a: ĐKXĐ: x<>-3; x<>3
\(M=\dfrac{2x^2-6x+x-3+x^2+3x-2x^2+8x+12}{\left(x-3\right)\left(x+3\right)}\)
\(=\dfrac{x^2+6x+9}{\left(x-3\right)\left(x+3\right)}=\dfrac{x+3}{x-3}\)
b: Để M là số nguyên dương thì \(\left\{{}\begin{matrix}x-3+6⋮x-3\\\dfrac{x+3}{x-3}>0\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}x-3\in\left\{1;-1;2;-2;3;-3;6;-6\right\}\\\left[{}\begin{matrix}x>3\\x< -3\end{matrix}\right.\end{matrix}\right.\)
\(\Leftrightarrow x\in\left\{4;5;6;9\right\}\)