a: \(P=\dfrac{\sqrt{a}\left(\sqrt{a}+1\right)}{\sqrt{a}+1}\cdot\dfrac{a-2\sqrt{a}-\sqrt{a}+2}{\sqrt{a}-2}\)
\(=\sqrt{a}\cdot\dfrac{\left(\sqrt{a}-2\right)\left(\sqrt{a}-1\right)}{\sqrt{a}-2}\)
\(=\sqrt{a}\left(\sqrt{a}-1\right)=a-\sqrt{a}\)
b: \(Q=\left(\dfrac{\sqrt{x}}{3+\sqrt{x}}+\dfrac{2x}{9-x}\right):\left(\dfrac{\sqrt{x}-1}{x-3\sqrt{x}}-\dfrac{2}{\sqrt{x}}\right)\)
\(=\dfrac{\sqrt{x}\left(3-\sqrt{x}\right)+2x}{\left(3-\sqrt{x}\right)\left(3+\sqrt{x}\right)}:\dfrac{\sqrt{x}-1-2\left(\sqrt{x}-3\right)}{\sqrt{x}\left(\sqrt{x}-3\right)}\)
\(=\dfrac{3\sqrt{x}-x+2x}{\left(3-\sqrt{x}\right)\left(3+\sqrt{x}\right)}\cdot\dfrac{\sqrt{x}\left(\sqrt{x}-3\right)}{\sqrt{x}-1-2\sqrt{x}+6}\)
\(=\dfrac{-x+5\sqrt{x}}{\left(3+\sqrt{x}\right)}\cdot\dfrac{-\sqrt{x}}{-\sqrt{x}+5}\)
\(=\dfrac{\sqrt{x}\left(\sqrt{x}-5\right)}{\left(\sqrt{x}+3\right)}\cdot\dfrac{\sqrt{x}}{-\left(\sqrt{x}-5\right)}=\dfrac{-x}{\sqrt{x}+3}\)

