ĐKXĐ: \(a\ge0;a\ne1\)
\(P=\left(2+\frac{\sqrt{a}\left(\sqrt{a}+1\right)}{\sqrt{a}+1}\right)\left(2-\frac{\sqrt{a}\left(\sqrt{a}-1\right)}{\sqrt{a}-1}\right)=\left(2+\sqrt{a}\right)\left(2-\sqrt{a}\right)=4-a\)
\(P=\sqrt{\frac{\sqrt{2}-1}{\sqrt{2}+1}}=\sqrt{\frac{\left(\sqrt{2}-1\right)^2}{\left(\sqrt{2}-1\right)\left(\sqrt{2}+1\right)}}=\frac{\sqrt{2}-1}{\sqrt{2-1}}=\sqrt{2}-1\)
\(\Rightarrow4-a=\sqrt{2}-1\Rightarrow a=5-\sqrt{2}\)