a) đkxđ: \(a>0;a\ne1\)
Ta có:
\(P=\frac{a\sqrt{a}-1}{a-\sqrt{a}}-\frac{a\sqrt{a}+1}{a+\sqrt{a}}+\left(1-\frac{1}{\sqrt{a}}\right)\left(\frac{\sqrt{a}+1}{\sqrt{a}-1}+\frac{\sqrt{a}-1}{\sqrt{a}+1}\right)\)
\(P=\frac{\left(\sqrt{a}-1\right)\left(a+\sqrt{a}+1\right)}{\sqrt{a}\left(\sqrt{a}-1\right)}-\frac{\left(\sqrt{a}+1\right)\left(a-\sqrt{a}+1\right)}{\sqrt{a}\left(\sqrt{a}+1\right)}+\frac{\sqrt{a}-1}{\sqrt{a}}.\frac{a+2\sqrt{a}+1+a-2\sqrt{a}+1}{\left(\sqrt{a}-1\right)\left(\sqrt{a}+1\right)}\)
\(P=\frac{a+\sqrt{a}+1}{\sqrt{a}}-\frac{a-\sqrt{a}+1}{\sqrt{a}}+\frac{2a+2}{\left(\sqrt{a}+1\right)\sqrt{a}}\)
\(P=\frac{2\sqrt{a}\left(\sqrt{a}+1\right)+2a+2}{\left(\sqrt{a}+1\right)\sqrt{a}}\)
\(P=\frac{2a+2\sqrt{a}+2a+2}{\left(\sqrt{a}+1\right)\sqrt{a}}\)
\(P=\frac{4a+2\sqrt{a}+2}{\left(\sqrt{a}+1\right)\sqrt{a}}\)
b) \(P=7\)
\(\Leftrightarrow\frac{4a+2\sqrt{a}+2}{\left(\sqrt{a}+1\right)\sqrt{a}}=7\)
\(\Leftrightarrow4a+2\sqrt{a}+2=7a+7\sqrt{a}\)
\(\Leftrightarrow3a+5\sqrt{a}-2=0\)
\(\Leftrightarrow\left(3a-\sqrt{a}\right)+\left(6\sqrt{a}-2\right)=0\)
\(\Leftrightarrow\left(3\sqrt{a}-1\right)\sqrt{a}+2\left(3\sqrt{a}-1\right)=0\)
\(\Leftrightarrow\left(3\sqrt{a}-1\right)\left(\sqrt{a}+2\right)=0\)
Mà \(\sqrt{a}+2\ge2\left(\forall a\right)\)
\(\Rightarrow3\sqrt{a}-1=0\Leftrightarrow3\sqrt{a}=1\)
\(\Leftrightarrow\sqrt{a}=\frac{1}{3}\Rightarrow a=\frac{1}{9}\)