# Completing the square, when it meant completing a square

**Teaches:** `deviation-square-is-the-gap`, `impossible-deviation` ·
**Assumes:** `half-sum-and-deviation`, `species-of-the-unknown` · **~40 min**

---

## The phrase is not a metaphor

Around 820, in Baghdad, Muḥammad ibn Mūsā al-Khwārizmī wrote a book whose title contains
the word *al-jabr* — restoration. The word became *algebra*. The book is not a book of
symbols; there are none. It is a book of instructions in prose, and its arguments are
carried out by cutting up and rearranging actual squares.

"Completing the square" is what it sounds like. You have a shape that is not a square. You
add the missing corner. Now it is a square, and a square has a side, and finding a side is
something you know how to do.

### Do the classic one with paper

> *A square and ten roots are equal to thirty-nine dirhams.*

In our notation, $x^2 + 10x = 39$. In his: a square patch of unknown side, plus ten strips
of that same side, together cover 39.

Cut this out and do it. It takes four minutes and it is worth more than the derivation.

1. Draw a square of side $x$. Its area is $x^2$. You do not know $x$.
2. You must attach ten strips of width 1 and length $x$ — total area $10x$. Split them
   evenly: attach a $5 \times x$ rectangle to the right edge and another to the bottom
   edge.
3. The figure you now have is an L. Its total area is $x^2 + 10x$, which the problem says
   is 39.
4. **The L has a bite out of its corner.** The missing piece is a $5 \times 5$ square.
   Add it.
5. The completed figure is a square of side $x+5$, and its area is $39 + 25 = 64$.
6. A square of area 64 has side 8. So $x + 5 = 8$, and $x = 3$.

Check: $9 + 30 = 39$. 

Nothing in that argument was symbolic. It was carpentry. And notice what "add 25 to both
sides" — the step every student is taught to perform and almost none can justify — turns
out to be: **buy the missing corner.** The 25 is not chosen by a rule about $(b/2)^2$. It
is the size of the hole.

> **Do this.** Solve $x^2 + 6x = 16$ by the same construction, with paper. Then $x^2 + 12x
> = 64$. State, in words and without symbols, how you knew what size corner to buy.

## His fifth case is our field

al-Khwārizmī sorted quadratics into six types, because with no negative numbers available
you cannot move terms across the equals sign freely, and each arrangement is a different
problem. His fifth is:

> **Squares and numbers equal roots.** $x^2 + c = bx$

and his worked example is *a square and twenty-one dirhams are equal to ten roots*:
$x^2 + 21 = 10x$. His instructions:

> Halve the number of the roots. It is 5. Multiply this by itself and the product is 25.
> Subtract from this the 21 which is connected with the square, and the remainder is 4.
> Extract its root, 2, and subtract this from half the roots, 5, leaving 3. This is the
> root you wanted, and the square is 9. **Or you may add the root to half the roots, and
> the sum is 7; this is the root of the square you sought for, and the square is 49.**

Stop and look at what he just did, because you have done it already.

Halve the number of roots. Square it. Subtract the number. Take the root. Add and subtract
from the half. That is, in every particular, the method of `quad-02-parts-of-500`: the
half-sum, the deviation, the plus-and-minus. And the reason is that his fifth case *is*
the two-parts problem. If $x^2 + 21 = 10x$ then $x(10-x) = 21$: **two parts of ten whose
product is twenty-one.** They are 3 and 7. His two answers are not two solutions to an
equation; they are the two parts, and each is a legitimate answer to "what is the first
part?"

This is the only one of his six types where he reports two answers, and now you can see
why: it is the only one that is secretly a question about splitting something in two, and
a split has two sides.

### Our field, in his language

The field family from `quad-03-assessors-rule` has true area $x(500-x)$. Ask when it is
40000:

$$x(500-x) = 40000 \quad\Longleftrightarrow\quad x^2 + 40000 = 500x$$

*A square and forty thousand dirhams are equal to five hundred roots.* Case five. Run his
instructions exactly as written: half the roots is 250; squared, 62500; subtract 40000,
leaving 22500; its root is 150; and the answers are $250 - 150 = 100$ and
$250 + 150 = 400$.

Both are real fields. The parcel with legs 100 and 400, and the parcel with legs 400 and
100. Same field, entered from either end of the family.

## The gnomon: our identity, as a shape

The dissection above added a corner. Ours removes one. Draw it:

1. Draw the square field: side 250, area 62500. This is the biggest field in the family.
2. Now make a field with $x = 100$. It has legs 100 and 400, area 40000.
3. Lay the second inside the first. The land you lost is $62500 - 40000 = 22500$, and
   $22500 = 150^2$.

The lost land is a square, of side 150 — which is exactly how far your cut sits from the
middle. That is the identity

$$x(500-x) \;=\; 62500 - (x-250)^2$$

as a picture: **a big square with a small square bitten out of the corner.** The Greeks
called that shape a gnomon and it is all over Euclid's Book II, which is a treatise on
this identity and its relatives written entirely without algebraic symbols.

> **Do this.** On squared paper, draw the 250-square once. Then draw, inside it, the
> fields for $x = 200$, $x = 150$, $x = 100$, $x = 50$. Each time, shade the square you
> lost and write its side length next to it. You are drawing $(x-250)^2$ five times, and
> you should be able to predict the sixth before you draw it.

## When he says it cannot be done

al-Khwārizmī adds a condition to case five, and it is the most modern-sounding sentence in
the book:

> if the product [of half the roots by itself] is less than the number of dirhams
> connected with the square, then the instance is impossible.

Half the roots, squared, is the ceiling. The number of dirhams is the product you asked
for. If you demand more than the ceiling, there is no such thing — and he says so, plainly,
seven hundred years before anyone wrote $b^2 - 4ac$.

Our version: demand a field of area 70000 and the method reports a removed square of area
$-7500$. No such square, no such field. You already met this wall in
`quad-02-parts-of-500`; here it is again, in the ninth century, stated as a rule of the
craft.

## One difference worth arguing about

In case four — $x^2 + 10x = 39$ — al-Khwārizmī gives one answer, $x=3$, and does not
mention $x = -13$. Not an oversight. $x$ is the side of a square he has drawn, and a side
of length $-13$ is not a thing, so there is nothing to report.

In case five he gives two, because both are lengths.

So the number of answers a quadratic "has" was, for him, a question about what the answers
were *of*. Our field problem agrees with him: $x = 100$ and $x = 400$ are both real
fields, so both are reported. Had we asked for the side of a square whose area exceeds its
perimeter by some amount, one root would be a length and the other would be nothing, and
the honest answer would be one.

> **Discuss.** We now say $x^2 + 10x = 39$ "has two solutions," $3$ and $-13$. Is that a
> better answer than al-Khwārizmī's, or a different question? What did we gain by
> admitting $-13$, and is there anything at all that we lost?

## Euclid got there first, and without algebra at all

One more layer, eleven hundred years earlier, because it changes how you should read
everything above.

*Elements* Book VI, Proposition 27, is this:

> Of all the parallelograms applied to the same straight line and deficient by
> parallelogrammic figures similar to that described on half the line, **the greatest is
> the one applied to the half.**

Strip the vocabulary. "Applied to a straight line, deficient by a square" is Euclid's way
of saying: take a segment, cut it, and form the rectangle on the two pieces. The
proposition says the rectangle is largest when you cut at the half. That is the theorem of
`quad-02-parts-of-500`, stated around 300 BC, proved with no numbers, no symbols, no
unknown, and no algebra of any kind.

And the very next proposition, VI.28, is the *construction* — given an area, find the cut
that produces it. That is solving the quadratic. Euclid places VI.27 immediately before it
for a reason he states outright: VI.28 carries the proviso that the given area **must not
exceed** the one on the half-line, or the construction cannot be carried out.

So the order is: the maximum first, then the solving, with the maximum serving as the
condition for the solving to be possible. That is exactly the order of this arc, and
exactly al-Khwārizmī's condition on case five, and exactly the discriminant. Three
traditions, twelve hundred years apart, in three different languages, none of them with a
graph, all reaching the same three facts in the same order.

If a student ever asks why they are being made to prove a maximum before they are allowed
to solve anything, that is the answer: **you cannot know which problems are solvable until
you know how large the answer can get.**

---

## Exit

1. Solve $x^2 + 8x = 84$ by paper dissection. Draw the corner you bought and give its
   area before you do any arithmetic on the equation.
2. Rewrite $x(500-x) = 52500$ in al-Khwārizmī's case-five form and solve it by his
   instructions, in words, without symbols.
3. *A square and one hundred dirhams are equal to twenty roots.* Solve it. How many
   answers, and why that many?
4. *A square and one hundred and twenty dirhams are equal to twenty roots.* Solve it, or
   show that it cannot be done, using only his condition.
5. In the gnomon picture, the lost land is $(x-250)^2$. Explain, using the picture and not
   the algebra, why cutting at 100 and cutting at 400 lose the same amount.
6. Take $x^2 + c = 500x$ and describe, in one sentence each, the three things that can
   happen as $c$ increases from 0 to 70000.

Answers: [`ANSWERS.md`](ANSWERS.md).

## Related

- The same identity as a tax overcharge rather than a dissection: `quad-03-assessors-rule`.
- The same identity as a change of variables: `quad-02-parts-of-500`.
- Sourcing for the al-Khwārizmī translations quoted here: [`../../SOURCES.md`](../../SOURCES.md).
