\(A=x^2+4=\left(x^2+4x+4\right)-4x=\left(x+2\right)^2-\sqrt{4x}=\left(x+2-\sqrt{4x}\right)\left(x+2+\sqrt{4x}\right)\)
\(B=x^4+4y^4=\left(x^4+4x^2y^2+4y^4\right)-4x^2y^2=\left(x^2+2y^2\right)^2-\left(2xy\right)^2=\left(x^2+2y^2-2xy\right)\left(x^2+2y^2+2xy\right)\)