In basic algebra, the quadratic formula is the solution of the quadratic equation. There are other ways to solve the quadratic equation instead of using the quadratic formula, such as factoring, completing the square, or graphing. However, using the quadratic formula is often the most convenient way.

$ax^2+bx+c=0.$

Here x represents an unknown, and a, b, and c are constants with a not equal to 0. One can easily verify that the quadratic formula satisfies the quadratic equation, by inserting the former into the latter. Each of the two solutions given by the quadratic formula is called a root of the quadratic equation.

## Derivation of the formula

Once a student understands how to complete the square, then he or she can derive the quadratic formula.[1][2] For that reason, the derivation is sometimes left as an exercise for the student, who can thereby experience rediscovery of this important formula.[3][4] The explicit derivation is as follows.

Divide the quadratic equation by a, which is allowed because a is non-zero:

$x^2 + \frac{b}{a} x + \frac{c}{a}=0.$

Subtract c/a from both sides of the equation, transforming it into the form

$x^2 + \frac{b}{a} x= -\frac{c}{a}.$
One way to think of this derivation is in geometric terms. Lengths are in green, and area is in red.

The quadratic equation is now in a form to which the method of completing the square can be applied. To "complete the square", add a constant to both sides of the equation such that the left hand side becomes a complete square:

$x^2+\frac{b}{a}x+\left( \frac{1}{2}\frac{b}{a} \right)^2 =-\frac{c}{a}+\left( \frac{1}{2}\frac{b}{a} \right)^2,$

which produces

$\left(x+\frac{b}{2a}\right)^2=-\frac{c}{a}+\frac{b^2}{4a^2}$

or (after rearranging the terms on the right hand side to have a common denominator)

$\left(x+\frac{b}{2a}\right)^2=\frac{b^2-4ac}{4a^2}.$

The square has thus been completed, as shown in the figure. Taking the square root of both sides yields

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

Isolating x gives the quadratic formula:

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

The plus-minus symbol "±" indicates that both

$x=\frac{-b + \sqrt {b^2-4ac}}{2a}\quad\text{and}\quad x=\frac{-b - \sqrt {b^2-4ac}}{2a}$

are solutions of the quadratic equation.[5] There are many alternatives of this derivation with minor differences, mostly concerning the manipulation of $a$.

Some sources, particularly older ones, use alternative parameterizations of the quadratic equation such as $ax^2-2bx+c=0$ [6] or $ax^2+2bx+c=0$,[7] where b has a magnitude one half of the more common one. These result in slightly different forms for the solution, but are otherwise equivalent.

## Historical development

Brahmagupta described the quadratic formula more clearly than anyone had done before.

The Indian mathematician Brahmagupta (597–668 AD) was first to clearly describe the quadratic formula, although prior civilizations had investigated quadratic equations, understood them fairly well, and developed methods for solving them.[8] Brahmagupta's formula was written in words, instead of symbols, in his treatise Brāhmasphuṭasiddhānta published in 628 AD.[9] What motivated him? Mathematics Professor Elizabeth Stapel answers that question:[10]

Somebody (possibly in seventh-century India) was solving a lot of quadratic equations by completing the square. At some point, he noticed that he was always doing the exact same steps in the exact same order for every equation. Taking advantage of one of the great powers and benefits of algebra (namely, the ability to deal with abstractions, rather than having to muck about with the numbers every single time), he made a formula out of what he'd been doing....

Brahmagupta's solution of the quadratic equation $ax^2+bx=c$ was as follows:

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. (Brahmasphutasiddhanta, Colebrook translation, 1817, page 346.)[11]

This is equivalent to:

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

The quadratic formula covering all cases was first obtained by Simon Stevin in 1594.[12] In 1637 René Descartes published La Géométrie containing the quadratic formula in the form we know today. The first appearance of the general solution in the modern mathematical literature appeared in a 1896 paper by Henry Heaton.[13]

## Importance of this solution

One way to remember it (tattoo)

Many equations that are not quadratic can be put in quadratic form, and thereby solved using the quadratic formula.[14] Unlike some of the other solution methods, the quadratic formula can be used to solve any quadratic equation.[15]

Among the many equations that one encounters while studying algebra, the quadratic formula is one of the most important.[16][17] For this reason, it is often memorized.[18][19] One way to memorize it is to repeatedly say it out loud,[20] and some authors suggest putting it to music.[21]

This formula is generally considered to be the most useful method of solving quadratic equations, although other methods can teach important skills.[22] Completing the square is one alternative method, but it is not as easy as using the quadratic formula, and is seldom used in practice to solve the quadratic equation.[22][23][24][25] However, completing the square turns out to be very useful for other purposes, such as putting the equations for conic sections into standard form.[26]

Another alternative method for solving the quadratic equation is factoring. However, that alternative has limited application, because only some quadratic equations can be solved that way.[22] Even when factoring is possible, that technique can be messy, but using the quadratic formula can be a bit messy too. [26]

## Other derivations

A number of alternative derivations of the quadratic formula can be found in the literature which either (a) are simpler than the standard completing the square method, (b) represent interesting applications of other frequently used techniques in algebra, or (c) offer insight into other areas of mathematics.

### Alternate method of completing the square

The great majority of algebra texts published over the last several decades teach completing the square using the sequence presented earlier: (1) divide each side by a, (2) rearrange, (3) then add the square of one-half of b/a.

However, as pointed out by Larry Hoehn in 1975, completing the square can accomplished by a different sequence that leads to a simpler sequence of intermediate terms: (1) multiply each side by 4a, (2) rearrange, (3) then add $b^2$.[27]

In other words, the quadratic formula can be derived as follows:

$ax^2+bx+c=0$
$4 a^2 x^2 + 4abx + 4ac=0$
$4 a^2 x^2 + 4abx = -4ac$
$4 a^2 x^2 + 4abx + b^2 = b^2 - 4ac$
$(2ax + b)^2 = b^2 - 4ac$
$2ax + b = \pm \sqrt{b^2-4ac}$
$2ax = -b \pm \sqrt{b^2-4ac}$
$x=\frac{-b\pm\sqrt{b^2-4ac\ }}{2a}$

This actually represents an ancient derivation of the quadratic formula, and was known to the Hindus at least as far back as 1025 A.D.[28] Compared with the derivation in standard usage, this alternate derivation is shorter, involves fewer computations with literal coefficients, avoids fractions until the last step, has simpler expressions, and uses simpler math. As Hoehn states, "it is easier 'to add the square of b' than it is 'to add the square of half the coefficient of the x term'".[27]

### By substitution

With this technique, we substitute $x=y+m$ into the quadratic to get:

$a(y+m)^2 + b(y+m) + c =0$

Expanding the result and then collecting the powers of $y$ produces:

$ay^2 + y(2am + b) + (am^2+bm+c) = 0$

We have not yet imposed a second condition on $y$ and $m$, so we now choose m so that the middle term vanishes. That is, $2am+b=0$ or $m=\frac{-b}{2a}$. Subtracting the constant term from both sides of the equation (to move it to the right hand side) and then dividing by a gives:

$y^2=\frac{-(am^2+bm+c)}{a}$

Substituting for $m$ gives:

$y^2=\frac{-(\frac{b^2}{4a}+\frac{-b^2}{2a}+c)}{a}=\frac{b^2-4ac}{4a^2}$

Therefore $y=\pm\frac{\sqrt{b^2-4ac}}{2a}$; substituting $x=y+m=y-\frac{b}{2a}$ provides the quadratic formula.

### By using algebraic identities

Let the roots of the standard quadratic equation be $x$ and $y$. At this point, we recall the identity:

$x-y=\pm\sqrt{(x+y)^2-4xy}$

We know[how?] that the sum of roots of the standard quadratic equation is given by $\frac{-b}{a}$ and the product by $\frac{c}{a}$. Hence the identity can be rewritten as:

$x-y=\pm\sqrt{(\frac{-b}{a})^2-\frac{4c}{a}}=\pm\frac{\sqrt{b^2-4ac}}{a}$

Now, $x=\frac{(x+y)+(x-y)}{2} = \frac{\frac{-b}{a}\pm\frac{\sqrt{b^2-4ac}}{a}}{2}=\frac{-b\pm\sqrt{b^2-4ac\ }}{2a}$

### By Lagrange resolvents

An alternative way of deriving the quadratic formula is via the method of Lagrange resolvents, which is an early part of Galois theory.[29] This method can be generalized to give the roots of cubic polynomials and quartic polynomials, and leads to Galois theory, which allows one to understand the solution of algebraic equations of any degree in terms of the symmetry group of their roots, the Galois group.

This approach focuses on the roots more than on rearranging the original equation. Given a monic quadratic polynomial

$x^2+px+q,$

assume that it factors as

$x^2+px+q=(x-\alpha)(x-\beta),$

Expanding yields

$x^2+px+q=x^2-(\alpha+\beta)x+\alpha \beta,$

where $p=-(\alpha+\beta)$ and $q=\alpha \beta$.

Since the order of multiplication does not matter, one can switch $\alpha$ and $\beta$ and the values of p and q will not change: one says that p and q are symmetric polynomials in $\alpha$ and $\beta$. In fact, they are the elementary symmetric polynomials – any symmetric polynomial in $\alpha$ and $\beta$ can be expressed in terms of $\alpha+\beta$ and $\alpha\beta.$ The Galois theory approach to analyzing and solving polynomials is: given the coefficients of a polynomial, which are symmetric functions in the roots, can one "break the symmetry" and recover the roots? Thus solving a polynomial of degree n is related to the ways of rearranging ("permuting") n terms, which is called the symmetric group on n letters, and denoted $S_n.$ For the quadratic polynomial, the only way to rearrange two terms is to swap them ("transpose" them), and thus solving a quadratic polynomial is simple.

To find the roots $\alpha$ and $\beta,$ consider their sum and difference:

\begin{align} r_1 &= \alpha + \beta\\ r_2 &= \alpha - \beta. \end{align}

These are called the Lagrange resolvents of the polynomial; notice that one of these depends on the order of the roots, which is the key point. One can recover the roots from the resolvents by inverting the above equations:

\begin{align} \alpha &= \textstyle{\frac{1}{2}}\left(r_1+r_2\right)\\ \beta &= \textstyle{\frac{1}{2}}\left(r_1-r_2\right). \end{align}

Thus, solving for the resolvents gives the original roots.

Formally, the resolvents are called the discrete Fourier transform (DFT) of order 2, and the transform can be expressed by the matrix $\left(\begin{smallmatrix}1 & 1\\ 1 & -1\end{smallmatrix}\right),$ with inverse matrix $\left(\begin{smallmatrix}1/2 & 1/2\\ 1/2 & -1/2\end{smallmatrix}\right).$ The transform matrix is also called the DFT matrix or Vandermonde matrix.

Now $r_1=\alpha + \beta$ is a symmetric function in $\alpha$ and $\beta,$ so it can be expressed in terms of p and q, and in fact $r_1 = -p,$ as noted above. But $r_2=\alpha - \beta$ is not symmetric, since switching $\alpha$ and $\beta$ yields $-r_2=\beta - \alpha$ (formally, this is termed a group action of the symmetric group of the roots). Since $r_2$ is not symmetric, it cannot be expressed in terms of the polynomials p and q, as these are symmetric in the roots and thus so is any polynomial expression involving them. However, changing the order of the roots only changes $r_2$ by a factor of $-1,$ and thus the square $\scriptstyle r_2^2 = (\alpha - \beta)^2$ is symmetric in the roots, and thus expressible in terms of p and q. Using the equation

$(\alpha - \beta)^2 = (\alpha + \beta)^2 - 4\alpha\beta\!$

yields

$r_2^2 = p^2 - 4q\!$

and thus

$r_2 = \pm \sqrt{p^2 - 4q}.\!$

If one takes the positive root, breaking symmetry, one obtains:

\begin{align} r_1 &= -p\\ r_2 &= \sqrt{p^2 - 4q} \end{align}

and thus

\begin{align} \alpha &= \textstyle{\frac{1}{2}}\left(-p+\sqrt{p^2 - 4q}\right)\\ \beta &= \textstyle{\frac{1}{2}}\left(-p-\sqrt{p^2 - 4q}\right) \end{align}

Thus the roots are

$\textstyle{\frac{1}{2}}\left(-p \pm \sqrt{p^2 - 4q}\right)$

which is the quadratic formula. Substituting $\scriptstyle p=\tfrac{b}{a}, q=\tfrac{c}{a}\!$ yields the usual form for when a quadratic is not monic. The resolvents can be recognized as $\scriptstyle \frac{r_1}{2} = \frac{-p}{2}=\frac{-b}{2a}\!$ being the vertex, and $\scriptstyle r_2^2=p^2-4q\!$ is the discriminant (of a monic polynomial).

A similar but more complicated method works for cubic equations, where one has three resolvents and a quadratic equation (the "resolving polynomial") relating $r_2$ and $r_3,$ which one can solve by the quadratic equation, and similarly for a quartic (degree 4) equation, whose resolving polynomial is a cubic, which can in turn be solved. However, the same method for a quintic equation yields a polynomial of degree 24, which does not simplify the problem, and in fact solutions to quintic equations in general cannot be expressed using only roots.