is well-known to anyone who has studied algebra. It is:

So where does this come from? As detailed in the wikipedia entry, it comes from the method of "completing the square." The idea is that if we can transform the first equation above to:

Then the left-hand side is

If we take the square root of the right side and subtract h, we've solved for x. The first step is to divide by a (which is non-zero or we wouldn't be bothering with this) and move the constant part to the right side:

So the h we are looking for is:

We need to add h

^{2}, like so:

Express the right side as a single fraction

Take square roots and isolate x:

As quoted in the wikipedia entry:

To the absolute number multiplied by four times the [coefficient of the] square, add the square of the [coefficient of the] middle term; the square root of the same, less the [coefficient of the] middle term, being divided by twice the [coefficient of the] square is the value.--Brahmagupta

(Brahmasphutasiddhanta (Colebrook translation, 1817, page 346)

I am puzzled by the little problem of the sign of the term 4ac in this quoted version. [UPDATE: I see. <Bonks self on head> They just set up the equation with c on the right-hand side to start with]