This is the identity from Heron's formula for the area of a triangle, given all three sides.
$$ (x+y+z) (-x+y+z)(x-y+z)(x+y-z) \; \; \color{magenta}{=} \color{red}{ \; \; 2 \left( y^2 z^2 + z^2 x^2 + x^2 y^2 \right) - x^4 - y^4 - z^4 } $$
When two or three of $x,y,z$ are square roots, this product clears them all because every term is squared. Multiply it out in this $x,y,z$ version, it will help you remember
Apparently this works with more variables: keep the first variable with no minus sign, and multiply the $2^{n-1}$ expressions with the other signs taking all combinations of $\pm$ signs. It is probably not too hard to prove that all exponents in the resulting polynomial are even, thus clearing all the square roots. I had it write out $n=4.$ Note that the coefficient of $w^2 x^2 y^2 z^2$ is $-40$
? f = (w + x + y + z ) * (w - x + y + z ) * (w + x - y + z ) * (w + x + y - z ) *
(w - x - y + z ) * (w - x + y - z ) * (w + x - y - z ) * (w - x - y - z )
%1 = x^8 + (-4*w^2 + (-4*y^2 - 4*z^2))*x^6 +
(6*w^4 + (4*y^2 + 4*z^2)*w^2 + (6*y^4 + 4*z^2*y^2 + 6*z^4))*x^4 +
(-4*w^6 + (4*y^2 + 4*z^2)*w^4 + (4*y^4 - 40*z^2*y^2 + 4*z^4)*w^2 + (-4*y^6 + 4*z^2*y^4 + 4*z^4*y^2 - 4*z^6))*x^2 +
(w^8 + (-4*y^2 - 4*z^2)*w^6 + (6*y^4 + 4*z^2*y^2 + 6*z^4)*w^4 + (-4*y^6 + 4*z^2*y^4 + 4*z^4*y^2 - 4*z^6)*w^2 + (y^8 - 4*z^2*y^6 + 6*z^4*y^4 - 4*z^6*y^2 + z^8))
?
? polcoeff(f, 8,x)
%2 = 1
? polcoeff(f, 7,x)
%3 = 0
? polcoeff(f, 6,x)
%4 = -4*w^2 + (-4*y^2 - 4*z^2)
? polcoeff(f, 5,x)
%5 = 0
? polcoeff(f, 4,x)
%6 = 6*w^4 + (4*y^2 + 4*z^2)*w^2 + (6*y^4 + 4*z^2*y^2 + 6*z^4)
? polcoeff(f, 3,x)
%7 = 0
? polcoeff(f, 2,x)
%8 = -4*w^6 + (4*y^2 + 4*z^2)*w^4 + (4*y^4 - 40*z^2*y^2 + 4*z^4)*w^2 + (-4*y^6 + 4*z^2*y^4 + 4*z^4*y^2 - 4*z^6)
? polcoeff(f, 1,x)
%9 = 0
? polcoeff(f, 0,x)
%10 = w^8 + (-4*y^2 - 4*z^2)*w^6 + (6*y^4 + 4*z^2*y^2 + 6*z^4)*w^4 + (-4*y^6 + 4*z^2*y^4 + 4*z^4*y^2 - 4*z^6)*w^2 + (y^8 - 4*z^2*y^6 + 6*z^4*y^4 - 4*z^6*y^2 + z^8)
?
=============================