\(\left(a+b+c\right)^2+\left(a-b+c\right)^2-4b^2\)
\(=2a^2+2b^2+2c^2+2ab+2ac+2bc-2ab-2bc+2ac-4b^2\)
\(=2a^2-2b^2+2c^2+4ac\)
\(=2\left[\left(a^2+2ac+c^2\right)-b^2\right]=2\left[\left(a+c\right)^2-b^2\right]\)
\(=2\left(a+c-b\right)\left(a+b+c\right)\)
\(\left(a+b+c\right)^2-\left(a-b+c\right)^2-4b^2\)
\(=a^2+b^2+c^2+2ab+2bc+2ca+a^2+b^2+c^2-2ab-2bc+2ca-4b^2\)
\(=2a^2-2b^2+2c^2+4ca\)
\(=2\left(a^2-b^2+c^2+2ac\right)\)
\(=2\left[\left(a+c\right)^2-b^2\right]\)
\(=2\left(a-b+c\right)\left(a+b+c\right)\)