\(\left(x+y+z\right)^2-2\left(x+y+z\right)\left(x+y\right)+\left(x+y\right)^2\\ =\left[\left(x+y+z\right)-\left(x+y\right)\right]^2\\ =z^2\)
\(\left(x+y+z\right)^2-2.\left(x+y+z\right).\left(x+y\right)+\left(x+y\right)^2\)
\(=\left[\left(x+y+z\right)-\left(x+y\right)\right]^2\)
\(=\left(x+y+z-x-y\right)^2\)