\(A=\frac{a\sqrt{a}-8}{a+2\sqrt{a}+4}=\frac{\left(\sqrt{a}\right)^3-8}{a+2\sqrt{a}+4}=\frac{\left(\sqrt{a}-2\right)\left[\left(\sqrt{a}\right)^2+2\sqrt{a}+4\right]}{a+2\sqrt{a}+4}=\frac{\left(\sqrt{a}-2\right)\left(a+2\sqrt{a}+4\right)}{a+2\sqrt{a}+4}\)
\(=\sqrt{a}-2\)
\(B=\frac{a\sqrt{a}+1}{\sqrt{a}+1}=\frac{\left(\sqrt{a}\right)^3+1}{\sqrt{a}+1}=\frac{\left(\sqrt{a}+1\right)\left[\left(\sqrt{a}\right)^2-\sqrt{a}+1\right]}{\sqrt{a}+1}=a-\sqrt{a}+1\)