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