From this you can easily come to the algebraic equation that you see in most textbooks:

If the legs are called a resp. b and the hypotenuse is called c, then the area of the
second to the last picture can be described by

I. a^{2}+b^{2}+4ab/2 = (a+b)^{2}

The last picture shows

II. c^{2}+4ab/2 = (a+b)^{2}

The right side of both of these equations is equal (both are in a square of the same size).

Therefore, the left side of the two equations is also equal.

a^{2}+b^{2}+4ab/2=c^{2}+4ab/2

Subtract 4ab/2 from each side to obtain the famous formula

a^{2}+b^{2}=c^{2}