\(M=\dfrac{x\sqrt{x}-3-2\left(x-6\sqrt{x}+9\right)-x-4\sqrt{x}-3}{\left(\sqrt{x}-3\right)\left(\sqrt{x}+1\right)}\)
\(=\dfrac{x\sqrt{x}-x-4\sqrt{x}-6-2x+12\sqrt{x}-18}{\left(\sqrt{x}-3\right)\left(\sqrt{x}+1\right)}\)
\(=\dfrac{x\sqrt{x}-3x+8\sqrt{x}-24}{\left(\sqrt{x}-3\right)\left(\sqrt{x}+1\right)}=\dfrac{x+8}{\sqrt{x}+1}\)