Ta có: \(\left(\frac{\sqrt{x}-2}{x-1}-\frac{\sqrt{x}+2}{x+\sqrt{x}+1}\right)\cdot\frac{\left(x-1\right)^2}{2}\)
\(=\left(\frac{\left(\sqrt{x}-2\right)\left(x+\sqrt{x}+1\right)}{\left(x-1\right)\left(x+\sqrt{x}+1\right)}-\frac{\left(\sqrt{x}+2\right)\left(x-1\right)}{\left(x+\sqrt{x}+1\right)\left(x-1\right)}\right)\cdot\frac{\left(x-1\right)^2}{2}\)
\(=\frac{x\sqrt{x}-x-\sqrt{x}-2-\left(x\sqrt{x}-\sqrt{x}+2x-2\right)}{\left(x+\sqrt{x}+1\right)\left(x-1\right)}\cdot\frac{\left(x-1\right)^2}{2}\)
\(=\frac{x\sqrt{x}-x-\sqrt{x}-2-x\sqrt{x}+\sqrt{x}-2x+2}{x+\sqrt{x}+1}\cdot\frac{x-1}{2}\)
\(=\frac{-3x^2+3x}{2x+2\sqrt{x}+2}\)