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