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