\(M=\dfrac{x+2}{x\sqrt{x}-1}+\dfrac{\sqrt{x}+1}{x+\sqrt{x}+1}-\dfrac{\sqrt{x}+1}{x-1}\)
\(=\dfrac{x+2}{\left(\sqrt{x}-1\right)\left(x+\sqrt{x}+1\right)}+\dfrac{\sqrt{x}+1}{x+\sqrt{x}+1}-\dfrac{\sqrt{x}+1}{\left(\sqrt{x}-1\right)\left(\sqrt{x}+1\right)}\)
\(=\dfrac{x+2}{\left(\sqrt{x}-1\right)\left(x+\sqrt{x}+1\right)}+\dfrac{\sqrt{x}+1}{x+\sqrt{x}+1}-\dfrac{1}{\sqrt{x}-1}\)
\(=\dfrac{x+2+\left(\sqrt{x}-1\right)\cdot\left(\sqrt{x}+1\right)-\left(x+\sqrt{x}+1\right)}{\left(x+\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\)
\(=\dfrac{x+2+x-1-x-\sqrt{x}-1}{\left(x+\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\)
\(=\dfrac{0+x-\sqrt{x}}{\left(x+\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\)
\(=\dfrac{\sqrt{x}\cdot\left(\sqrt{x}-1\right)}{\left(x+\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\)
\(=\dfrac{\sqrt{x}}{x+\sqrt{x}+1}\)
Đặt \(\sqrt{x}=a\)
\(M=\dfrac{a^2+2}{a^3-1}+\dfrac{a+1}{a^2+a+1}-\dfrac{a+1}{a^2-1}\)
\(=\dfrac{a^2+2}{a^3-1}+\dfrac{a+1}{a^2+a+1}-\dfrac{a+1}{\left(a+1\right)\left(a-1\right)}\)
\(=\dfrac{a^2+2}{a^3-1}+\dfrac{a+1}{a^2+a+1}-\dfrac{1}{a-1}\)
\(=\dfrac{a^2+2}{a^3-1}+\dfrac{\left(a+1\right)\left(a-1\right)-\left(a^2+a+1\right)}{\left(a^2+a+1\right)\left(a-1\right)}\)
\(=\dfrac{a^2+2}{a^3-1}+\dfrac{a^2-1-a^2-a-1}{a^3-1}\)
\(=\dfrac{a^2+2}{a^3-1}+\dfrac{-a-2}{a^3-1}\)
\(=\dfrac{a^2+2-a-2}{a^3-1}\)
\(=\dfrac{a^2-a}{a^3-1}\)
\(\Rightarrow M=\dfrac{x-\sqrt{x}}{x\sqrt{x}-1}\)