\(P=\dfrac{-x+5\sqrt{x}-22}{x+2\sqrt{x}-15}+\dfrac{3\sqrt{x}-1}{\sqrt{x}+5}-\dfrac{\sqrt{x}-5}{\sqrt{x}-3}\)
\(=\dfrac{-x+5\sqrt{x}-22}{\left(\sqrt{x}+5\right)\left(\sqrt{x}-3\right)}+\dfrac{3\sqrt{x}-1}{\sqrt{x}+5}-\dfrac{\sqrt{x}-5}{\sqrt{x}-3}\)
\(=\dfrac{-x+5\sqrt{x}-22+\left(3\sqrt{x}-1\right)\left(\sqrt{x}-3\right)-\left(\sqrt{x}-5\right)\left(\sqrt{x}+5\right)}{\left(\sqrt{x}+5\right)\left(\sqrt{x}-3\right)}\)
\(=\dfrac{-x+5\sqrt{x}-22+3x-10\sqrt{x}+3-x+25}{\left(\sqrt{x}+5\right)\left(\sqrt{x}-3\right)}\)
\(=\dfrac{x-5\sqrt{x}+6}{\left(\sqrt{x}+5\right)\left(\sqrt{x}-3\right)}=\dfrac{\left(\sqrt{x}-3\right)\left(\sqrt{x}-2\right)}{\left(\sqrt{x}+5\right)\left(\sqrt{x}-3\right)}\)
\(=\dfrac{\sqrt{x}-2}{\sqrt{x}+5}\)