\(P=\dfrac{x\sqrt{x}-3}{x-2\sqrt{x}-3}-\dfrac{2\left(\sqrt{x}-3\right)}{\sqrt{x}+1}+\dfrac{\sqrt{x}+3}{3-\sqrt{x}}\)
\(=\dfrac{x\sqrt{x}-3}{\left(\sqrt{x}-3\right)\left(\sqrt{x}+1\right)}-\dfrac{2\left(\sqrt{x}-3\right)}{\sqrt{x}+1}+\dfrac{-\left(\sqrt{x}+3\right)}{\sqrt{x}-3}\\ =\dfrac{x\sqrt{x}-3-2\left(\sqrt{x}-3\right)^2-\left(\sqrt{x}+3\right)\left(\sqrt{x}+1\right)}{\left(\sqrt{x}-3\right)\left(\sqrt{x}+1\right)}\)
\(=\dfrac{x\sqrt{x}-3-2x+12\sqrt{x}-18-x-\sqrt{x}-3\sqrt{x}-3}{\left(\sqrt{x}-3\right)\left(\sqrt{x}+1\right)}\\ =\dfrac{-3x-24+x\sqrt{x}+8\sqrt{x}}{\left(\sqrt{x}-3\right)\left(\sqrt{x}+1\right)}\\ =\dfrac{-3\left(x+8\right)+\sqrt{x}\left(x+8\right)}{\left(\sqrt{x}-3\right)\left(\sqrt{x}+1\right)}\\ =\dfrac{\left(x+8\right)\left(\sqrt{x}-3\right)}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-3\right)}=\dfrac{x+8}{\sqrt{x}+1}\)