\(x^4-y^4+2x^3y-2xy^3\)
\(=\left(x^2+y^2\right)\left(x^2-y^2\right)+2xy\left(x^2-y^2\right)\)
\(=\left(x^2-y^2\right)\left(x^2+y^2+2xy\right)\)
\(=\left(x-y\right)\left(x+y\right)\left(x+y\right)^2\)
\(=\left(x-y\right)\left(x+y\right)^3\)
\(x^4-y^4+2x^3y-2xy^3\\ =\left(x^2\right)^2-\left(y^2\right)^2+2xy\left(x^2-y^2\right)\\ =\left(x^2-y^2\right)\left(x^2+y^2\right)+2xy\left(x^2-y^2\right)\\ =\left(x^2-y^2\right)\left(x^2+y^2+2xy\right)\\ =\left(x-y\right)\left(x+y\right)\left(x+y\right)^2\\ =\left(x-y\right)\left(x+y\right)^3\)