a: \(A=\dfrac{x-\sqrt{x}+1-3+2\sqrt{x}+2}{\left(\sqrt{x}+1\right)\left(x-\sqrt{x}+1\right)}\)
\(=\dfrac{x+\sqrt{x}}{\left(\sqrt{x}+1\right)\left(x-\sqrt{x}+1\right)}=\dfrac{\sqrt{x}}{x-\sqrt{x}+1}\)
b: \(B=\left(\dfrac{2\sqrt{x}}{\left(x+1\right)\left(\sqrt{x}-1\right)}-\dfrac{1}{\sqrt{x}-1}\right):\dfrac{x+\sqrt{x}+1}{x+1}\)
\(=\dfrac{2\sqrt{x}-x-1}{\left(\sqrt{x}-1\right)\left(x+1\right)}\cdot\dfrac{x+1}{x+\sqrt{x}+1}\)
\(=\dfrac{-\left(\sqrt{x}-1\right)^2}{\sqrt{x}-1}\cdot\dfrac{1}{x+\sqrt{x}+1}=\dfrac{-\sqrt{x}+1}{x+\sqrt{x}+1}\)