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