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