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

