ĐKXĐ: \(a>0\)
\(D=\frac{\sqrt{a}\left(a\sqrt{a}+1\right)}{a-\sqrt{a}+1}-\frac{\sqrt{a}\left(2\sqrt{a}+1\right)}{\sqrt{a}}+1\)
\(=\frac{\sqrt{a}\left(\sqrt{a}+1\right)\left(a-\sqrt{a}+1\right)}{a-\sqrt{a}+1}-\left(2\sqrt{a}+1\right)+1\)
\(=a+\sqrt{a}-2\sqrt{a}=a-\sqrt{a}\)
\(D=2\Rightarrow a-\sqrt{a}=2\)
\(\Rightarrow a-\sqrt{a}-2=0\Rightarrow\left[{}\begin{matrix}\sqrt{a}=-1\left(l\right)\\\sqrt{a}=2\end{matrix}\right.\) \(\Rightarrow a=4\)
\(D=a-\sqrt{a}=\sqrt{a}\left(\sqrt{a}-1\right)\)
Với \(a>1\Rightarrow\sqrt{a}-1>0\Rightarrow D>0\Rightarrow D=\left|D\right|\)
\(D=a-\sqrt{a}=a-\sqrt{a}+\frac{1}{4}-\frac{1}{4}=\left(\sqrt{a}-\frac{1}{2}\right)^2-\frac{1}{4}\ge-\frac{1}{4}\)
\(\Rightarrow D_{min}=-\frac{1}{4}\) khi \(\sqrt{a}=\frac{1}{2}\Rightarrow a=\frac{1}{4}\)