Quadratic equation is derived by completing the square:
ax^2 + bx + c = 0
Subtract c from both sides:
ax^2 + bx = -c
Divide by a:
x^2 + (b/a)x = -c/a
Complete the square by taking half of b/a and squaring it, then adding to both sides:
Note: (b/a) * 1/2 = b/(2a)
x^2 + (b/a)x + (b/(2a))^2 = -c/a + (b/(2a))^2
Simplify:
x^2 + (b/a)x + b^2/(4a^2) = -c/a + b^2/(4a^2)
Factor:
(x - (b/(2a))))^2 = -c/a + b^2/(4a^2)
Take the square root:
x + (b/(2a)) = +/- sqrt(-c/a + b^2/(4a^2))
Subtract b/(2a) from both sides:
x = -b/(2a) +/- sqrt(-c/a + b^2/(4a^2))
Simplify:
x = -b/(2a) +/- sqrt( -4ac b^2 )
------- + ---------
4a^2 4a^2
x = -b +/- sqrt (b^2 - 4ac)
--------------------------
2a