a: \(A=x^2-x\sqrt{y}-2x\sqrt{y}+2y\)
\(=x\left(x-\sqrt{y}\right)-2\sqrt{y}\left(x-\sqrt{y}\right)\)
\(=\left(x-\sqrt{y}\right)\left(x-2\sqrt{y}\right)\)
b: \(A=\left[\sqrt{5}+2-\left(\sqrt{5}-2\right)\right]\left[\sqrt{5}+2-2\left(\sqrt{5}-2\right)\right]\)
\(=\left(\sqrt{5}+2-\sqrt{5}+2\right)\left(\sqrt{5}+2-2\sqrt{5}+4\right)\)
\(=4\left(6-\sqrt{5}\right)=24-4\sqrt{5}\)