ĐKXĐ: ...
\(P=\left(\frac{\sqrt{a}-1}{a+\sqrt{a}+1}-\frac{1-3\sqrt{a}+a}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}-\frac{1}{\sqrt{a}-1}\right):\frac{a+1}{1-\sqrt{a}}\)
\(=\left(\frac{\left(\sqrt{a}-1\right)^2-1+3\sqrt{a}-a-\left(a+\sqrt{a}+1\right)}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}\right)\left(\frac{1-\sqrt{a}}{a+1}\right)\)
\(=\frac{-\left(a+1\right)}{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}.\frac{-\left(\sqrt{a}-1\right)}{\left(a+1\right)}=\frac{1}{a+\sqrt{a}+1}\)