Euclid's Elements Book II Proposition 5
If a straight line is cut into equal and unequal segments, then the rectangle contained by the unequal segments of the whole together with the square on the straight line between the points of section equals the square on the half
Let a straight line AB be cut into equal segments at C and into unequal segments at D.

I say that the rectangle AD by DB together with the square on CD equals the square on CB.

Describe the square CEFB on CB, and join BE.

Draw DG through D parallel to either CE or BF, again draw KM through H parallel to either AB or EF, and again draw AK through A parallel to either CL or BM.

Then, since the complement CH equals the complement HF, add DM to each.

Therefore the whole CM equals the whole DF.

But CM equals AL, since AC is also equal to CB. Therefore AL also equals DF. Add CH to each. Therefore the whole AH equals the gnomon NOP.

But AH is the rectangle AD by DB, for DH equals DB, therefore the gnomon NOP also equals the rectangle AD by DB.

Add LG, which equals the square on CD, to each.

Therefore the sum of the gnomon NOP and LG equals the sum of the rectangle AD by DB and the square on CD.

But the gnomon NOP together with LG is the whole square CEFB, which is described on CB.

Therefore the rectangle AD by DB together with the square on CD equals the square on CB.

Therefore if a straight line is cut into equal and unequal segments, then the rectangle contained by the unequal segments of the whole together with the square on the straight line between the points of section equals the square on the half.

Proposition 4 <-- Proposition 5 --> Proposition 6