a:ĐKXĐ: \(\left\{{}\begin{matrix}x>0\\x\ne1\end{matrix}\right.\)
\(P=\dfrac{4}{\sqrt{x}+1}-\dfrac{2}{\sqrt{x}}-\dfrac{\sqrt{x}-7}{x-1}\)
\(=\dfrac{4\sqrt{x}-2\left(\sqrt{x}+1\right)}{\sqrt{x}\left(\sqrt{x}+1\right)}-\dfrac{\sqrt{x}-7}{\left(\sqrt{x}-1\right)\left(\sqrt{x}+1\right)}\)
\(=\dfrac{2\sqrt{x}-2}{\sqrt{x}\left(\sqrt{x}+1\right)}-\dfrac{\sqrt{x}-7}{\left(\sqrt{x}-1\right)\left(\sqrt{x}+1\right)}\)
\(=\dfrac{\left(2\sqrt{x}-2\right)\left(\sqrt{x}-1\right)-x+7\sqrt{x}}{\sqrt{x}\left(\sqrt{x}-1\right)\cdot\left(\sqrt{x}+1\right)}\)
\(=\dfrac{2x-4\sqrt{x}+2-x+7\sqrt{x}}{\left(\sqrt{x}-1\right)\left(\sqrt{x}+1\right)\cdot\sqrt{x}}=\dfrac{x+3\sqrt{x}+2}{\sqrt{x}\left(\sqrt{x}-1\right)\left(\sqrt{x}+1\right)}=\dfrac{\sqrt{x}+2}{\sqrt{x}\left(\sqrt{x}-1\right)}\)
b: Để P=2 thì \(2\sqrt{x}\left(\sqrt{x}-1\right)=\sqrt{x}+2\)
=>\(2x-2\sqrt{x}-\sqrt{x}-2=0\)
=>\(2x-4\sqrt{x}+\sqrt{x}-2=0\)
=>\(\left(\sqrt{x}-2\right)\left(2\sqrt{x}+1\right)=0\)
=>\(\left[{}\begin{matrix}x=4\left(nhận\right)\\\sqrt{x}=-\dfrac{1}{2}\left(loại\right)\end{matrix}\right.\)