# Deriving the Quadratic Formula

Note: This is not needed for exams. It requires moderate
algebra knowledge and uses completing the square.

## How to derive the quadratic formula

Start with the general quadratic equation and make $$x$$ the subject: $0=ax^2+bx+c$
Factor $$a$$ out and divide through on both sides: \begin{align} 0&=a\left(x^2+\frac{bx}{a}+\frac{c}{a}\right) \\[8pt]0&=x^2+\frac{bx}{a}+\frac{c}{a} \end{align}
Complete the square, not expanding $$(2a)^2$$ in some cases to avoid later factorisation: \begin{align} x^2+\frac{bx}{a}+\frac{c}{a}&=\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{(2a)^2}+\frac{c}{a} \\[8pt]0&=\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{(2a)^2}+\frac{c}{a} \\[8pt]\left(x+\frac{b}{2a}\right)^2&=\frac{b^2}{(2a)^2}-\frac{c}{a} \\[8pt]x+\frac{b}{2a}&=\pm\sqrt{\frac{b^2}{(2a)^2}-\frac{c}{a}} \\[8pt]x&=\frac{-b}{2a}\pm\sqrt{\frac{b^2}{(2a)^2}-\frac{c}{a}} \end{align}
This would work as an alternative but let's rearrange to make it easier to use: \begin{align} \frac{-b}{2a}\pm\sqrt{\frac{b^2a}{(2a)^2a}-\frac{(2a)^2c}{(2a)^2a}}&=x \\[8pt]\frac{-b}{2a}\pm\sqrt{\frac{b^2a-4a^2c}{(2a)^2a}}&=x \\[8pt]\frac{-b}{2a}\pm\sqrt{\frac{b^2-4ac}{(2a)^2}}&=x \\[8pt]\frac{-b}{2a}\pm\frac{\sqrt{b^2-4ac}}{\sqrt{(2a)^2}}&=x \\[8pt]\frac{-b}{2a}\pm\frac{\sqrt{b^2-4ac}}{2a}&=x \\[8pt]\frac{-b\pm\sqrt{b^2-4ac}}{2a}&=x \end{align}

There you have it! Obviously this is fairly long-winded to do during an exam so you should learn the last equation by heart. However, it's always good to know where things come from.