Lời giải:
a) ĐK: $a>0; a\neq 1$
b)
\(B=\left(\frac{\sqrt{a}+2}{(\sqrt{a}+1)^2}-\frac{\sqrt{a}-2}{a-1}\right).\frac{\sqrt{a}+1}{\sqrt{a}}=\frac{\sqrt{a}+2}{(\sqrt{a}+1)^2}.\frac{\sqrt{a}+1}{\sqrt{a}}-\frac{\sqrt{a}-2}{a-1}.\frac{\sqrt{a}+1}{\sqrt{a}}\)
\(=\frac{\sqrt{a}+2}{\sqrt{a}(\sqrt{a}+1)}-\frac{(\sqrt{a}-2)(\sqrt{a}+1)}{\sqrt{a}(a-1)}=\frac{(\sqrt{a}+2)(\sqrt{a}-1)}{(a-1)\sqrt{a}}-\frac{(\sqrt{a}-2)(\sqrt{a}+1)}{\sqrt{a}(a-1)}\)
\(=\frac{(a+\sqrt{a}-2)-(a-\sqrt{a}-2)}{(a-1)\sqrt{a}}=\frac{2\sqrt{a}}{\sqrt{a}(a-1)}=\frac{2}{a-1}\) (đpcm)