a) ĐKXĐ: \(\left\{{}\begin{matrix}x\ge0\\x\ne4\end{matrix}\right.\)
Ta có: \(P=\frac{\sqrt{x}+1}{\sqrt{x}-2}+\frac{2\sqrt{x}}{\sqrt{x}+2}+\frac{2+5\sqrt{x}}{4-x}\)
\(=\frac{\left(\sqrt{x}+1\right)\left(\sqrt{x}+2\right)}{\left(\sqrt{x}-2\right)\left(\sqrt{x}+2\right)}+\frac{2\sqrt{x}\left(\sqrt{x}-2\right)}{\left(\sqrt{x}+2\right)\left(\sqrt{x}-2\right)}-\frac{2+5\sqrt{x}}{\left(\sqrt{x}-2\right)\left(\sqrt{x}+2\right)}\)
\(=\frac{x+3\sqrt{x}+2+2x-4\sqrt{x}-2-5\sqrt{x}}{\left(\sqrt{x}+2\right)\left(\sqrt{x}-2\right)}\)
\(=\frac{3x-6\sqrt{x}}{\left(\sqrt{x}+2\right)\left(\sqrt{x}-2\right)}\)
\(=\frac{3\sqrt{x}\left(\sqrt{x}-2\right)}{\left(\sqrt{x}+2\right)\left(\sqrt{x}-2\right)}\)
\(=\frac{3\sqrt{x}}{\sqrt{x}+2}\)
b) Để P=2 thì \(\frac{3\sqrt{x}}{\sqrt{x}+2}=2\)
\(\Leftrightarrow3\sqrt{x}=2\left(\sqrt{x}+2\right)\)
\(\Leftrightarrow3\sqrt{x}=2\sqrt{x}+4\)
\(\Leftrightarrow3\sqrt{x}-2\sqrt{x}=4\)
\(\Leftrightarrow\sqrt{x}=4\)
hay x=16(nhận)
Vậy: để P=2 thì x=16
c) Để P có giá trị là số nguyên thì \(3\sqrt{x}⋮\sqrt{x}+2\)
\(\Leftrightarrow3\sqrt{x}+6-6⋮\sqrt{x}+2\)
mà \(3\sqrt{x}+6⋮\sqrt{x}+2\)
nên \(-6⋮\sqrt{x}+2\)
\(\Leftrightarrow\sqrt{x}+2\inƯ\left(-6\right)\)
\(\Leftrightarrow\sqrt{x}+2\in\left\{1;-1;2;-2;3;-3;6;-6\right\}\)
\(\Leftrightarrow\sqrt{x}+2\in\left\{2;3;6\right\}\)(Vì \(\sqrt{x}+2\ge2\forall x\) thỏa mãn ĐKXĐ)
\(\Leftrightarrow\sqrt{x}\in\left\{0;1;4\right\}\)
hay \(x\in\left\{0;1;16\right\}\)(nhận)
Vậy: Để P nguyên thì \(x\in\left\{0;1;16\right\}\)