\(A=\frac{\left(x^4+2\right)^2-x^4}{x^4+x^2+2}=\frac{\left(x^4+x^2+2\right)\left(x^4-x^2+2\right)}{x^4+x^2+2}=x^4-x^2+2\)
\(B=\frac{a+9b+6\sqrt{ab}-4\sqrt{ab}}{\sqrt{a}+3\sqrt{b}-2\sqrt{\sqrt{ab}}}-2\sqrt{b}=\frac{\left(\sqrt{a}+3\sqrt{b}\right)^2-\left(2\sqrt{\sqrt{ab}}\right)^2}{\sqrt{a}+3\sqrt{b}-2\sqrt{\sqrt{ab}}}-2\sqrt{b}\)
\(=\frac{\left(\sqrt{a}+3\sqrt{b}-2\sqrt{\sqrt{ab}}\right)\left(\sqrt{a}+3\sqrt{b}+2\sqrt{\sqrt{ab}}\right)}{\sqrt{a}+3\sqrt{b}-2\sqrt{\sqrt{ab}}}-2\sqrt{b}\)
\(=\sqrt{a}+3\sqrt{b}+2\sqrt{\sqrt{ab}}-2\sqrt{b}\)
\(=\sqrt{a}+\sqrt{b}+2\sqrt{\sqrt{ab}}\)
\(=\left(\sqrt{\sqrt{a}}+\sqrt{\sqrt{b}}\right)^2=\left(\sqrt[4]{a}+\sqrt[4]{b}\right)^2\)