# Al Khwarizmi’s Identity and the Quadratic Formula

The quadratic formula is a main tool for understanding quadratic relations. It is based on al Khwarizmi's technique of completing the square.
Al Khwarizmi is often considered the father of algebra, due to an influential text he wrote, and his name is the origin of the term algorithm. His `completing-the-square’ technique lies at the heart of a beautiful formula that we call al Khwarizmi’s identity. The usual quadratic formula is a consequence.
• will see how the completing-the-square leads to al Khwarizmi’s identity
• how the quadratic formula follows from al Khwarizmi’s identity
On this page is a very important derivation. Make sure you proceed slowly and carefully, please check all the steps by writing things out line by line, and then apply your understanding to work out the answers to the questions. This is how we learn mathematics.

## Solving a quadratic equation using completing the square

Suppose we want to solve the quadratic equation
[Large{x^2-14x-1887=0}.]
Half of the coefficient of (normalsize{x}) is (normalsize{-7}), so we take the (normalsize{1887}) to the other side, and add the square of (normalsize{-7}) to both sides. This gives
[Large{x^2-14x+49=1887+49=1936}.]
Now we rewrite the left-hand side as a perfect square:
[Large{(x-7)^2=1936}.]
At this stage we have to “take the square root” of (normalsize{1936}). What does this mean? It means finding a number (normalsize{r}) with the property that (normalsize{r^2=1936}). In this case such a number actually exists: it is (normalsize{r=44}). But otherwise we would just write (normalsize{pm sqrt{1936}}) to represent an approximate square root, and its negative. We can’t forget about the negative, since we want two solutions!
So in our case (normalsize{x-7=44}) or (normalsize{x-7=-44}). Thus we do get two solutions, namely (normalsize{x=51}) or (normalsize{x=-37}).

## Deriving al Khwarizmi’s identity

Now let’s apply this to transform the general quadratic polynomial
[Large{ax^2+bx+c}]
where (aneq 0). First step, factor out the (normalsize{a}) to get
[Large{ax^2+bx+c = a left( x^2+frac{b}{a}x+frac{c}{a}right) }.]
Add and subtract (normalsize{left(frac{b}{2a}right)^2}) inside the right hand expression:
[Large{ax^2+bx+c = a left( x^2+frac{b}{a}x + left(frac{b}{2a}right)^2 +frac{c}{a} -left(frac{b}{2a}right)^2right)}.]
Now there is a perfect square inside these brackets:
[Large{ax^2+bx+c = a left( left(x+frac{b}{2a}right)^2 +frac{c}{a} -left(frac{b}{2a}right)^2right)}.]
Since
[{Large frac{c}{a} -left(frac{b}{2a}right)^2 = frac{4ac-b^2}{(2a)^2}}]
we get
[Large{ax^2+bx+c = a left( left(x+frac{b}{2a}right)^2 +frac{4ac-b^2}{(2a)^2}right)}.]
Now for the last step, we multiply through by (normalsize{a}) to get
[Large{ax^2+bx+c=aleft(x+frac{b}{2a}right)^2+frac{4ac-b^2}{4a}. label{1} tag 1}]
This is one of the really great derivations in mathematics, resulting in an essential formula, which we call al Khwarizmi’s identity. This step has lots of questions to give you practice with this formula!
Q1 (E): Apply the steps above to rewrite (normalsize{x^2+12x-85}) using al Khwarizmi’s identity.
Q2 (M): Apply the steps above to rewrite (normalsize{3x^2+5x-22}) using al Khwarizmi’s identity.

## Solving quadratic equations using al Khwarizmi’s identity

Once we have written a quadratic function in the form of al Khwarizmi’s identity, solving a quadratic equation involving it is relatively easy.
For example suppose that we want to solve (normalsize{x^2+12x-85=0}). Having already solved Q1, we rewrite this equation as
[Large{x^2+12x-85=(x+6)^2-121=0}]
and then as
[Large{(x+6)^2=121}.]
Now taking square roots, (normalsize{x+6=11}) or (normalsize{x+6=-11}) from which we deduce that (normalsize{x=5}) or (normalsize{x=-17}). These are the two solutions.
Q3 (M): i) Solve (normalsize{x^2+12x-85=-21}).
Q4 (M): i) Solve (normalsize{3x^2+5x-22=0}) using al Khwarizmi’s identity.

The familiar quadratic formula follows from al Khwarizmi’s identity.
If (normalsize{ax^2+bx+c = 0}) then
[Large{ax^2+bx+c=aleft(x+frac{b}{2a}right)^2+frac{4ac-b^2}{4a}=0}.]
So
[Large{ left(x+frac{b}{2a}right)^2 = frac{b^2-4ac}{(2a)^2}}.]
Taking square roots
[Large{ x+frac{b}{2a}=pmfrac{sqrt{b^2-4ac}}{2a}}.]
And finally, we isolate (x)
[Large{ x= frac{- b pmsqrt{b^2-4ac}}{2a}}.]
This is the famous equation that all students memorise.
Q5 (E): Use the quadratic formula to solve (normalsize{x^2+4x+3=0}).

Once we know how to solve quadratics, Descartes theorem allows us a simpler way to factor a quadratic expression: just find its zeroes first, and then each of these will correspond to a linear factor!
Q6 (E) Use the quadratic formula and Descartes’ theorem to factor (normalsize{x^2+x-132}).

A1. We transform the quadratic expression (normalsize{x^2+12x-85}) to
[Large{begin{align}x^2+12x-85&=x^2+12x+6^2-85-6^2\&=(x+6)^2-121.end{align}}]
A2. We transform
[Large{begin{align}3x^2+5x-22&=3Bigg(x^2+frac{5}{3}x+Bigg(frac{5}{6}Bigg)^2-frac{22}{3}-Bigg(frac{5}{6}Bigg)^2Bigg)\&=3Bigg(Bigg(x+frac{5}{6}Bigg)^2-frac{22}{3}-frac{25}{36}Bigg)\&=3Bigg(x+frac{5}{6}Bigg)^2-22-frac{25}{12}\&=3Bigg(x+frac{5}{6}Bigg)^2-frac{289}{12}.end{align}}]
A3.
We use the working of A1. to rewrite (normalsize{x^2+12x-85=-21}) as
[Large{x^2+12x-85=(x+6)^2-121=-21}.]
This gives
[Large{(x+6)^2=100}.]
In this case we can take square roots, giving (normalsize{x+6=10}) or (normalsize{x+6=-10}), from which we deduce that (normalsize{x=4}) or (normalsize{x=-16}). These are the two solutions.
A4.
We use the working of A2. to write (normalsize{3x^2+5x-22=0}) as
[Large{3x^2+5x-22=3Bigg(x+frac{5}{6}Bigg)^2-frac{289}{12}=0}.]
This gives
[Large{Bigg(x+frac{5}{6}Bigg)^2=frac{289}{36}}.]
So taking square roots, (normalsize{x+5/6=17/6}) or (normalsize{x+5/6=-17/6}) from which we deduce that (normalsize{x=12/6=2}) or (normalsize{x=-22/6=-11/3}). These are the two solutions.
A5. Using the quadratic formula we have:
[Large{x=frac{-4+sqrt{16-12}}{2}=-frac{2}{2}=-1}]
and
[Large{x=frac{-4-sqrt{16-12}}{2}=-frac{6}{2}=-3}.]
A6. Solving equation (normalsize{x^2+x-132=0}) we have zeroes
[Large{x=frac{-1+sqrt{1+528}}{2}=11}]
and
[Large{x=frac{-1-sqrt{1+528}}{2}=-12}]
hence
[Large{x^2+x-132=(x-11)(x+12)=0}.]
You are now in a position to systematically solve all quadratic factorisation problems, without any guess work. Thank you al Khwarizmi!

Created by