I was thinking about the difference between the area of a rectangle that is not a square, and a square with sides whose lengths are at the midpoint between the lengths of $a$ and $b$. I did some algebraic manipulation and it seems that the difference between the area of the square, $((a+b)/2)^2$, and the area of the rectangle, $ab$, is $(a^2+b^2)/4 - (ab)/2$.
Now if you had a right triangle with sides $a$ and $b$, it's hypotenuse would be the square root of $a^2 + b^2$.
So what I'm wondering is why the difference between the area of the square and the rectangle is the same as the difference between one fourth the square of the hypotenuse of the right triangle with sides $a$ and $b$, and $1/2$ the rectangle $ab$? If you were trying to find this difference purely with geometry, what steps could you take to reach this conclusion, starting from the original square and rectangle?

