# How to derive the equation for x in a quadratic equation? [duplicate]

Possible Duplicate:

How to derive this: $x = \frac{-b + {\sqrt{b^2 + 4ac}}}{2a}$

From this:

$ax^2 + bx + c = 0$

I know this may be a little elementary :)

-

## marked as duplicate by Pedro Tamaroff♦, Gigili, Ross Millikan, MJD, AangSep 27 '12 at 9:14

For many ways to derive it, please see this link – André Nicolas Sep 27 '12 at 2:41

The usual approach is to complete the square:

\begin{align*} ax^2+bx+c&=a\left(x^2+\frac{b}ax+\frac{c}a\right)\\ &=a\left(\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{4a^2}+\frac{c}a\right)\\ &=a\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{4a}+c\;, \end{align*}

which equals $0$ if and only if $$a\left(x+\frac{b}{2a}\right)^2=\frac{b^2}{4a}-c=\frac{b^2-4ac}{4a}\;.$$ Now divide both sides by $a$ to get

$$\left(x+\frac{b}{2a}\right)^2=\frac{b^2-4ac}{4a^2}\;,$$ and take square roots:

$$x+\frac{b}{2a}=\pm\sqrt{\frac{b^2-4ac}{4a^2}}=\pm\frac1{2a}\sqrt{b^2-4ac}\;.$$ Hence

$$x=-\frac{b}{2a}\pm\frac1{2a}\sqrt{b^2-4ac}=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\;.$$

-
How did you get the plus/minus sign in LaTeX? – Soham Chowdhury Sep 27 '12 at 2:49
@Soham: \pm. You can right-click on a MathJax formula, select Show Math As, and then select TeX Commands to see what was actually typed. – Brian M. Scott Sep 27 '12 at 2:50
Thanks. Nice answer by the way. – Soham Chowdhury Sep 27 '12 at 4:40
@Soham: You’re welcome. And thank you! – Brian M. Scott Sep 27 '12 at 4:47

Since $a\neq0$ we can divide the equation by $a$ and have it as $x^{2}+px+q=0$ where $p=\frac{b}{a},q=\frac{c}{a}$.

Note $$x^{2}+px+q=(x+\frac{p}{2})^{2}+q-\frac{p^{2}}{4}$$ so we need to solve $(x+\frac{p}{2})^{2}+q-\frac{p^{2}}{4}=0$

so we have it that $(x+\frac{p}{2})^{2}=q-\frac{p^{2}}{4}$. now take the square root, reduce $\frac{p}{2}$ from both sides and substitute $p,q$.

-

from $ax^2 + bx + c = 0 \Leftrightarrow 4a^2x^2 + 4abx + b^2 = b^2 - 4ac$.

Hence $(2ax + b)^2 = b^2 - 4ac$ then $2ax + b = \pm \sqrt{b^2 - 4ac}$.

from this, we have $x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}$

-

First off, note that you can easily transform the equation to $x^2-2dx+e=0$ by simply dividing out $a$ and a factor $-2$, then we're looking to explain the solution $x=d\pm\sqrt{d^2-e}$.

Since $x^2-2dx+e=(x^2-2dx+d^2)-(d^2-e)=(x-d)^2-(d^2-e)=0$, taking the square root yields $x-d=\pm\sqrt{d^2-e}$, which was requested.

-