a: \(P=\left(\dfrac{2+\sqrt{x}-1}{\left(\sqrt{x}-1\right)\left(\sqrt{x}+1\right)}\right):\dfrac{\sqrt{x}+1-\sqrt{x}}{\sqrt{x}+1}\)
\(=\dfrac{1}{\sqrt{x}-1}\cdot\dfrac{\sqrt{x}+1}{1}=\dfrac{\sqrt{x}+1}{\sqrt{x}-1}\)
b: Để P nguyên thì \(\sqrt{x}+1⋮\sqrt{x}-1\)
\(\Leftrightarrow\sqrt{x}-1\in\left\{-1;1;2\right\}\)
hay \(x\in\left\{0;4;9\right\}\)