Ta có :
\(\left(x+y\right)\left(x+z\right)+\left(y+z\right)+\left(y+x\right)\)
\(=x^2+xz+xy+yz+y^2+xy+zy+xz\)
\(=x^2+y^2+2\left(xy+yz+zx\right)\)
\(2\left(x+z\right)\left(z+y\right)\)
\(=2\left(xz+z^2+xy+zy\right)\)
\(=2z^2+2\left(xy+yz+zx\right)\)
\(\Rightarrow x^2+y^2+2\left(xy+yz+zx\right)=2z^2+2\left(xy+yz+zx\right)\)
\(\Rightarrow x^2+y^2=2z^2\)
\(\Rightarrow z^2=\frac{x^2+y^2}{2}\)