a: \(\left(x+y\right)^2+\left(x-y\right)^2\)
\(=x^2+2xy+y^2+x^2-2xy+y^2\)
\(=2x^2+2y^2=2\left(x^2+y^2\right)\)
b: \(m^3+n^3+p^3-3mnp\)
\(=\left(m+n\right)^3+p^3-3mn\left(m+n\right)-3mnp\)
\(=\left(m+n+p\right)\left[\left(m+n\right)^2-p\left(m+n\right)+p^2\right]-3mn\left(m+n+p\right)\)
\(=\left(m+n+p\right)\left(m^2+2mn+n^2-mp-np+p^2-3mn\right)\)
\(=\left(m+n+p\right)\left(m^2+n^2+p^2-mp-np-mn\right)\)