\(\left(x+2y\right)\left(x^2-2xy+4y^2\right)=0\)
\(\Leftrightarrow x^3+8y^3=0\)
\(\Leftrightarrow x^3=-8y^3\)
\(\left(x-2y\right)\left(x^2+2xy+4y^2\right)=16\)
\(\Leftrightarrow x^3-8y^3=16\)
\(\Leftrightarrow-8y^3-8y^3=16\)
\(\Leftrightarrow y^3=-1\Rightarrow y=-1\Rightarrow x=2\)