Lời giải:
a.
\(P=\frac{4(\sqrt{x}-1)-2(\sqrt{x}+1)}{(\sqrt{x}-1)(\sqrt{x}+1)}-\frac{\sqrt{x}-7}{(\sqrt{x}-1)(\sqrt{x}+1)}\\ =\frac{2\sqrt{x}-6}{(\sqrt{x}-1)(\sqrt{x}+1)}-\frac{\sqrt{x}-7}{(\sqrt{x}-1)(\sqrt{x}+1)}\\ =\frac{\sqrt{x}+1}{(\sqrt{x}-1)(\sqrt{x}+1)}=\frac{1}{\sqrt{x}-1}\)
b.
$P=2\Leftrightarrow \frac{1}{\sqrt{x}-1}=2$
$\Leftrightarrow \sqrt{x}-1=\frac{1}{2}$
$\Leftrightarrow \sqrt{x}=\frac{3}{2}$
$\Leftrightarrow x=\frac{9}{4}$ (tm)