Book II · Proposition 8

II.8

If a straight line be cut at random, four times the rectangle contained by the whole and one of the segments together with the square on the remaining segment is equal to the square described on the whole and the aforesaid segment as on one straight line.Heath, 1908

4(a+b)b + a^2 = (a+2b)^2.

ABCDNM
18 lines and circles drawn, of which 5 helper constructions drew the fainter ones

Every step, checked

What it needs, and what needs it

Needs: I.3 II.4 II.7

Rests on: C.N.1, C.N.2, C.N.3, C.N.4, C.N.5, Def.10, Def.15, Def.22, Def.4, Post.5

Depth: 14 steps of argument above the first principles. Parallel postulate: needed.

What it takes on trust

The proposition as code

@proposition(
    "II.8",
    THEOREM,
    sample=_adjacent_segments,
    note="4(a+b)b + a^2 = (a+2b)^2.",
)
def prop_II_8(a: Point, b: Point, c: Point) -> Out:
    """AC is cut at B, and BC is added again beyond C."""
    hypothesis("B cuts AC", between(a, b, c))
    # CD is cut off equal to CB, which is I.3's business; the ray is produced
    # twice the length so that I.3 has the greater line it asks for.
    reach = Point(c.x + 2 * (c.x - b.x), c.y + 2 * (c.y - b.y))
    beyond = posit(prop_I_3(c, reach, b, c).cut, "D")
    because(prop_II_4, a, b, c)
    because(prop_II_7, a, b, c)

    square = _rectangle(a, beyond, _across(a, beyond), "M", "N")
    outline(a, beyond, close=False)

    whole, part, rest = length(a, c), length(b, c), length(a, b)
    claim("CD equals CB, so AD is the whole with that segment added again", ["I.3", "C.N.2"],
          eq_len(c, beyond, b, c) and length(a, beyond) == whole + part)
    claim("the square described on AD equals four times the rectangle on the whole "
          "and the segment, together with the square on the remaining segment",
          ["II.4", "II.7"],
          _area(*square) == 4 * (whole * part) + rest * rest)
    return Out(square=square)