\(B=\dfrac{4}{\sqrt{x}+1}+\dfrac{2}{1-\sqrt{x}}-\dfrac{\sqrt{x}-5}{x-1}\left(x\ge0;x\ne1\right)\\ =\dfrac{4\left(\sqrt{x}-1\right)}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}-\dfrac{2\left(\sqrt{x}+1\right)}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}-\dfrac{\sqrt{x}-5}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\\ =\dfrac{4\sqrt{x}-4-2\sqrt{x}-2-\sqrt{x}+5}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\\ =\dfrac{\sqrt{x}-1}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\\ =\dfrac{1}{\sqrt{x}+1}\)
\(M=\left(\dfrac{1}{\sqrt{x}-1}-\dfrac{1}{\sqrt{x}+1}\right):\dfrac{x+1}{x-1}\left(x\ge0;x\ne1\right)\\ =\dfrac{\sqrt{x}+1-\sqrt{x}+1}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}:\dfrac{x+1}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\\ =\dfrac{2}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\cdot\dfrac{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}{x+1}\\ =\dfrac{2}{x+1}\)