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