ĐKXĐ: ...
\(P=\frac{\left(\sqrt{x}-1\right)\left(x+\sqrt{x}+1\right)}{\sqrt{x}\left(\sqrt{x}-1\right)}-\frac{\left(\sqrt{x}+1\right)\left(x-\sqrt{x}+1\right)}{\sqrt{x}\left(\sqrt{x}+1\right)}+\frac{x+1}{\sqrt{x}}\)
\(=\frac{x+\sqrt{x}+1}{\sqrt{x}}-\frac{x-\sqrt{x}+1}{\sqrt{x}}+\frac{x+1}{\sqrt{x}}\)
\(=\frac{x+\sqrt{x}+1-x+\sqrt{x}-1+x+1}{\sqrt{x}}=\frac{x+2\sqrt{x}+1}{\sqrt{x}}=\frac{\left(\sqrt{x}+1\right)^2}{\sqrt{x}}\)