Solving quadratics in pictures

Share this page

A Babylonian inscription from around 2800 BC.

Algebra is old: the Babylonians, a people who lived around 3000 years ago, already knew about versions of the famous formula for solving quadratic equations. But what they were inspired by was geometry: they needed to solve quadratics in order to work out problems involving areas of plots of land. So to celebrate their achievement, let's derive the famous quadratic formula using geometry.

Suppose the quadratic equation you are looking at is

  \[ x^2 + px = q, \]    

with $p$ and $q$ both positive numbers.

The term $x^2$ gives the area of a square with sides of length $x.$ The term $px$ gives the area of a rectangle with one side of length $p$ and the other side of length $x$. We can put the square and the rectangle next to each other to get a larger rectangle:

The area of this larger rectangle is $x^2+px$ which, by our equation, is equal to $q.$ But it turns out that we can rearrange it to very nearly form a square. Simply slice the small rectangle into two strips with sides of lengths $x$ and $p/2$:

And move one strip so it aligns with the bottom edge of the square:

Let’s call this region $R$. It still has area $x^2+px = q.$ But if we add a little square of side length $p/2$ to the bottom right corner of $R$ we get a big square with side length $x+p/2$ and area $\left(x+p/2\right)^2.$ Therefore,

  \[  \mbox{Area of the big square} = \left(x+p/2\right)^2 = \mbox{Area of R}+ \left(p/2\right)^2 = q + \left(p/2\right)^2. \]    

Taking the square root of both sides gives

  \[ x+p/2 = \pm {\sqrt{q + p^2/4}}. \]    

Subtracting $p/2$ from both sides gives

  \begin{equation} x = \pm {\sqrt{q + p^2/4}}-p/2.\end{equation}   (1)

How is that related to the quadratic formula we learn about at school? We usually write a general quadratic equation as

  \[ ax^2+bx+c=0. \]    

Dividing through by $a$ so that the coefficient of $x^2$ is 1 gives

  \[ x^2 + \frac{b}{a}x + \frac{c}{a} = 0. \]    

Bringing $\frac{c}{a}$ over to the other side gives

  \[ x^2 + \frac{b}{a}x = -\frac{c}{a}. \]    

So comparing with our equation above we see $p=\frac{b}{a}$ and $q=-\frac{c}{a}.$ Substituting these for $p$ and $q$ in expression (1) recovers the general quadratic formula

  \[ x = \frac{-b\pm {\sqrt{b^2-4ac}}}{2a}. \]    

To say that the Babylonians knew this formula is a little misleading. Firstly, they didn't know about negative numbers, so they could only solve quadratics that had a positive solution. Also, they didn't write their maths using symbols and letters as we do, but using words. So a Babylonian student might be given questions such as:

If I add to the area of a square twice its side, I get 48. What is the side?

Which, writing $x$ for the side, translates to the equation

  \[ x^2+2x=48. \]    

The Babylonians knew about sequences of steps they could perform to find the solution to such a question — which is why we say they knew about the quadratic formula.



After the part where the rectangles are rearranged, it says: "still has area p^2 +px=q...".
It should be x^2 instead of p^2.

  • Want facts and want them fast? Our Maths in a minute series explores key mathematical concepts in just a few words.

  • As COP28, the 2023 United Nations Climate Change Conference, kicks off we look at how maths can help understand the climate crisis.

  • How do you create dramatic film out of mathematics? We find out with writer and director Timothy Lanzone.

  • Mathematics plays a central role in understanding how infectious diseases spread. This collection of articles looks at some basic concepts in epidemiology to help you understand this fascinating and important field, and set you up for further study.

  • Find out why the formula we use to work out conditional probabilities is true!

  • We talk about a play that explores the fascinating mathematical collaboration between the mathematicians GH Hardy and Srinivasa Ramanujan.