Completing the square is the geometric or algebraic operation that forms a square
from a quadratic polynomial.
The Old Babylonian tablet MS 5112 shown above contains problems solved by metric-algebra transformations equivalent to completing the square (Friberg 2007).
Al-Khwarizmi's ninth-century Al-jabr, represented above by a 1342 manuscript copy, solved quadratic equations using verbal
and geometric forms of this operation (Berggren 2007).
For example, the geometric construction illustrated above corresponds to al-Khwarizmi's "square
and ten roots equal 39," which in modern notation becomes
(3)
(4)
(5)
where only the positive root is admitted in the original geometrical setting. The added area completes the square of side (Berggren 2007).