ĐKXĐ: \(\left\{{}\begin{matrix}a\ge0\\a\ne1\end{matrix}\right.\)
a) Ta có: \(P=\dfrac{\sqrt{a}-1}{3\sqrt{a}+\left(\sqrt{a}-1\right)^2}-\dfrac{6-2\left(\sqrt{a}-1\right)^2}{a\sqrt{a}-1}+\dfrac{2}{\sqrt{a}-1}\)
\(=\dfrac{\sqrt{a}-1}{a+\sqrt{a}+1}-\dfrac{-2a+4\sqrt{a}+4}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}+\dfrac{2}{\sqrt{a}-1}\)
\(=\dfrac{\left(\sqrt{a}-1\right)^2}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}-\dfrac{-2a+4\sqrt{a}+4}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}+\dfrac{2\left(a+\sqrt{a}+1\right)}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}\)
\(=\dfrac{a-2\sqrt{a}+1+2a-4\sqrt{a}-4+2a+2\sqrt{a}+2}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}\)
\(=\dfrac{5a-4\sqrt{a}-1}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}\)
\(=\dfrac{5a-5\sqrt{a}+\sqrt{a}-1}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}\)
\(=\dfrac{5\sqrt{a}\left(\sqrt{a}-1\right)+\left(\sqrt{a}-1\right)}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}\)
\(=\dfrac{\left(\sqrt{a}-1\right)\left(5\sqrt{a}+1\right)}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}\)
\(=\dfrac{5\sqrt{a}+1}{a+\sqrt{a}+1}\)
b) Để P=1 thì \(5\sqrt{a}+1=a+\sqrt{a}+1\)
\(\Leftrightarrow a+\sqrt{a}+1-5\sqrt{a}-1=0\)
\(\Leftrightarrow a-4\sqrt{a}=0\)
\(\Leftrightarrow\sqrt{a}\left(\sqrt{a}-4\right)=0\)
\(\Leftrightarrow\left[{}\begin{matrix}\sqrt{a}=0\\\sqrt{a}-4=0\end{matrix}\right.\Leftrightarrow\left[{}\begin{matrix}a=0\left(nhận\right)\\a=16\left(nhận\right)\end{matrix}\right.\)
Vậy: Để P=1 thì \(a\in\left\{0;16\right\}\)