a. \(P=\dfrac{3a+\sqrt{9a}-3}{a+\sqrt{a}-2}-\dfrac{\sqrt{a}+1}{\sqrt{a}+2}+\dfrac{\sqrt{a}-2}{1-\sqrt{a}}\) \(\left(a\ge0,a\ne1\right)\)
\(P=\dfrac{3a+3\sqrt{a}-3-\left(\sqrt{a}+1\right)\left(\sqrt{a}-1\right)-\left(\sqrt{a}-2\right)\left(\sqrt{a}+2\right)}{\left(\sqrt{a}-1\right)\left(\sqrt{a}+2\right)}\)
\(P=\dfrac{3a+3\sqrt{a}-3-a+1-a+4}{\left(\sqrt{a}-1\right)\left(\sqrt{a}+2\right)}\)
\(P=\dfrac{a+3\sqrt{a}+2}{\left(\sqrt{a}-1\right)\left(\sqrt{a}+2\right)}=\dfrac{a+\sqrt{a}+2\sqrt{a}+2}{\left(\sqrt{a}-1\right)\left(\sqrt{a}+2\right)}=\dfrac{\sqrt{a}\left(\sqrt{a}+1\right)+2\left(\sqrt{a}+1\right)}{\left(\sqrt{a}-1\right)\left(\sqrt{a}+2\right)}\)
\(P=\dfrac{\left(\sqrt{a}+1\right)\left(\sqrt{a}+2\right)}{\left(\sqrt{a}-1\right)\left(\sqrt{a}+2\right)}=\dfrac{\sqrt{a}+1}{\sqrt{a}-1}\)
b. \(P=\dfrac{\sqrt{a}+1}{\sqrt{a}-1}=\dfrac{\sqrt{a}-1+2}{\sqrt{a}-1}=1+\dfrac{2}{\sqrt{a}-1}\)
Để: \(P\in Z\Rightarrow\sqrt{a}-1\inƯ\left(2\right)=\left\{1;-1;2;-2\right\}\)
\(\Rightarrow\left\{{}\begin{matrix}\sqrt{a}=2\\\sqrt{a}=0\\\sqrt{a}=3\\\sqrt{a}=-1\left(l\right)\end{matrix}\right.\) \(\Rightarrow\left\{{}\begin{matrix}a=4\\a=0\\a=9\end{matrix}\right.\)
Vậy: \(a\in\left\{4;0;9\right\}\)