\(\frac{x^2-\sqrt{x}}{x+\sqrt{x}+1}-\frac{2x+\sqrt{x}}{\sqrt{x}}+\frac{2\left(x-1\right)}{\sqrt{x}-1}\)
\(=\frac{\sqrt{x}\left(\sqrt{x}-1\right)\left(x+\sqrt{x}+1\right)}{x+\sqrt{x}+1}-\frac{\sqrt{x}\left(2\sqrt{x}+1\right)}{\sqrt{x}}+\frac{2\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}{\sqrt{x}-1}\)
\(=x-\sqrt{x}-2\sqrt{x}-1+2\sqrt{x}+2\)
\(=x-\sqrt{x}+1\)