\(P=\dfrac{2x+8+x-4\sqrt{x}-8\sqrt{x}-8}{\left(\sqrt{x}-4\right)\left(\sqrt{x}+1\right)}\)
\(=\dfrac{3\sqrt{x}}{\sqrt{x}+1}\)
Để P là số nguyên thì \(3\sqrt{x}-3+3⋮\sqrt{x}+1\)
\(\Leftrightarrow\sqrt{x}+1\in\left\{1;3\right\}\)
hay \(x\in\left\{0;4\right\}\)