\(P=\left(\dfrac{\left(\sqrt{x}-4\right)\left(\sqrt{x}-2\right)+3x+6\sqrt{x}}{\sqrt{x}\left(x-4\right)}\right):\dfrac{x\sqrt{x}-2\sqrt{x}+2x-4-x}{\sqrt{x}\left(x-2\right)}\)
\(=\dfrac{4x-2\sqrt{x}-8}{\sqrt{x}\left(x-4\right)}\cdot\dfrac{\sqrt{x}\left(x-2\right)}{x\sqrt{x}+x-2\sqrt{x}-4}\)
\(=\dfrac{4x-2\sqrt{x}-8}{x-4}\cdot\dfrac{x-2}{x\sqrt{x}+x-2\sqrt{x}-4}\)