# The Quadratic Formula

We can use the technique of completing the square to solve the general quadratic equation $ax^2 + bx + c = 0$, as can be seen below.

$$\begin{array}{rclc} ax^2 + bx + c &=& 0\\\\ a(x^2 + \frac{b}{a}x\, + \,?\,) + c &=& 0 & \scriptsize{\textrm{factoring out the a and leaving room for a 3rd term}}\\\\ a(x^2 + \frac{b}{a}x + \frac{b^2}{4a^2}) + c - \frac{b^2}{4a} &=& 0 & \overset{\normalsize{\textrm{we insert half the square of the linear coefficient to}}}{\scriptsize{\textrm{complete the square and then compensate for this insertion}}}\\\\ a(x + \frac{b}{2a})^2 + \frac{4ac - b^2}{4a} &=& 0 & \overset{\normalsize{\textrm{taking advantage of the square-of-a-binomial form, we}}}{\scriptsize{\textrm{rewrite things so that there is only a single occurrence of x}}}\\\\ a(x + \frac{b}{2a})^2 &=& \frac{b^2 - 4ac}{4a} & \overset{\normalsize{\textrm{from this point, things are straight-forward --}}}{\scriptsize{\textrm{simply isolate the single x on one side...}}}\\\\ (x + \frac{b}{2a})^2 &=& \frac{b^2 - 4ac}{4a^2}\\\\ x + \frac{b}{2a} &=& \pm \sqrt{\frac{b^2 - 4ac}{4a^2}}\\\\ x + \frac{b}{2a} &=& \frac{\pm \sqrt{b^2 - 4ac}}{|2a|}\\\\ x + \frac{b}{2a} &=& \frac{\pm \sqrt{b^2 - 4ac}}{2a} & \overset{\normalsize{\textrm{note, the absolute value doesn't really}}}{\scriptsize{\textrm{matter, given the \pm that is present}}}\\\\ x &=& - \frac{b}{2a} + \frac{\pm \sqrt{b^2 - 4ac}}{2a}\\\\ x &=& \frac{-b \pm \sqrt{b^2-4ac}}{2a} \end{array}$$

Thus, we can be assured that if $ax^2+bx+c=0$, then $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$$

This last equation is known as the quadratic formula and provides a shortcut that let's us get around having to go through all of the steps of completing the square to arrive at a solution to an arbitrary quadratic equation.