
In
elementary algebra
Elementary algebra, also known as high school algebra or college algebra, encompasses the basic concepts of algebra. It is often contrasted with arithmetic: arithmetic deals with specified numbers, whilst algebra introduces variable (mathematics ...
, the quadratic formula is a
closed-form expression
In mathematics, an expression or equation is in closed form if it is formed with constants, variables, and a set of functions considered as ''basic'' and connected by arithmetic operations (, and integer powers) and function composition. ...
describing the solutions of a
quadratic equation
In mathematics, a quadratic equation () is an equation that can be rearranged in standard form as
ax^2 + bx + c = 0\,,
where the variable (mathematics), variable represents an unknown number, and , , and represent known numbers, where . (If and ...
. Other ways of solving quadratic equations, such as
completing the square
In elementary algebra, completing the square is a technique for converting a quadratic polynomial of the form to the form for some values of and . In terms of a new quantity , this expression is a quadratic polynomial with no linear term. By s ...
, yield the same solutions.
Given a general quadratic equation of the form , with representing an unknown, and
coefficient
In mathematics, a coefficient is a Factor (arithmetic), multiplicative factor involved in some Summand, term of a polynomial, a series (mathematics), series, or any other type of expression (mathematics), expression. It may be a Dimensionless qu ...
s , , and representing known
real or
complex
Complex commonly refers to:
* Complexity, the behaviour of a system whose components interact in multiple ways so possible interactions are difficult to describe
** Complex system, a system composed of many components which may interact with each ...
numbers with , the values of satisfying the equation, called the
''roots'' or ''zeros'', can be found using the quadratic formula,
where the
plus–minus symbol "" indicates that the equation has two roots. Written separately, these are:
The quantity is known as the
discriminant of the quadratic equation. If the coefficients , , and are real numbers then when , the equation has two distinct
real roots; when , the equation has one
repeated real root; and when , the equation has ''no'' real roots but has two distinct complex roots, which are
complex conjugate
In mathematics, the complex conjugate of a complex number is the number with an equal real part and an imaginary part equal in magnitude but opposite in sign. That is, if a and b are real numbers, then the complex conjugate of a + bi is a - ...
s of each other.
Geometrically, the roots represent the values at which the
graph of the
quadratic function
In mathematics, a quadratic function of a single variable (mathematics), variable is a function (mathematics), function of the form
:f(x)=ax^2+bx+c,\quad a \ne 0,
where is its variable, and , , and are coefficients. The mathematical expression, e ...
, a
parabola
In mathematics, a parabola is a plane curve which is Reflection symmetry, mirror-symmetrical and is approximately U-shaped. It fits several superficially different Mathematics, mathematical descriptions, which can all be proved to define exactl ...
, crosses the -axis: the graph's -intercepts. The quadratic formula can also be used to identify the parabola's
axis of symmetry.
Derivation by completing the square

The standard way to derive the quadratic formula is to apply the method of
completing the square
In elementary algebra, completing the square is a technique for converting a quadratic polynomial of the form to the form for some values of and . In terms of a new quantity , this expression is a quadratic polynomial with no linear term. By s ...
to the generic quadratic equation . The idea is to manipulate the equation into the form for some expressions and written in terms of the coefficients; take the
square root
In mathematics, a square root of a number is a number such that y^2 = x; in other words, a number whose ''square'' (the result of multiplying the number by itself, or y \cdot y) is . For example, 4 and −4 are square roots of 16 because 4 ...
of both sides; and then isolate .
We start by dividing the equation by the quadratic coefficient , which is allowed because is non-zero. Afterwards, we subtract the constant term to isolate it on the right-hand side:
The left-hand side is now of the form , and we can "complete the square" by adding a constant to obtain a squared binomial . In this example we add to both sides so that the left-hand side can be factored (see the figure):
Because the left-hand side is now a perfect square, we can easily take the square root of both sides:
Finally, subtracting from both sides to isolate produces the quadratic formula:
Equivalent formulations
The quadratic formula can equivalently be written using various alternative expressions, for instance
which can be derived by first dividing a quadratic equation by , resulting in , then substituting the new coefficients into the standard quadratic formula. Because this variant allows re-use of the intermediately calculated quantity , it can slightly reduce the arithmetic involved.
Square root in the denominator
A lesser known quadratic formula, first mentioned by
Giulio Fagnano, describes the same roots via an equation with the square root in the denominator (assuming ):
Here the
minus–plus symbol "" indicates that the two roots of the quadratic equation, in the same order as the standard quadratic formula, are
This variant has been jokingly called the "citardauq" formula ("quadratic" spelled backwards).
When has the opposite sign as either or , subtraction can cause
catastrophic cancellation, resulting in poor accuracy in numerical calculations; choosing between the version of the quadratic formula with the square root in the numerator or denominator depending on the sign of can avoid this problem. See below.
This version of the quadratic formula is used in
Muller's method for finding the roots of general functions. It can be derived from the standard formula from the identity , one of
Vieta's formulas
In mathematics, Vieta's formulas relate the coefficients of a polynomial to sums and products of its roots. They are named after François Viète (1540-1603), more commonly referred to by the Latinised form of his name, "Franciscus Vieta."
Basi ...
. Alternately, it can be derived by dividing each side of the equation by to get , applying the standard formula to find the two roots , and then taking the reciprocal to find the roots of the original equation.
Other derivations
Any generic method or algorithm for solving quadratic equations can be applied to an equation with symbolic coefficients and used to derive some closed-form expression equivalent to the quadratic formula. Alternative methods are sometimes simpler than completing the square, and may offer interesting insight into other areas of mathematics.
Completing the square by Śrīdhara's method
Instead of dividing by to isolate , it can be slightly simpler to multiply by instead to produce , which allows us to complete the square without need for fractions. Then the steps of the derivation are:
# Multiply each side by .
# Add to both sides to complete the square.
# Take the square root of both sides.
# Isolate .
Applying this method to a generic quadratic equation with symbolic coefficients yields the quadratic formula:
This method for completing the square is ancient and was known to the 8th–9th century Indian mathematician
Śrīdhara. Compared with the modern standard method for completing the square, this alternate method avoids fractions until the last step and hence does not require a rearrangement after step 3 to obtain a common denominator in the right side.
[
]
By substitution
Another derivation uses a change of variables to eliminate the linear term. Then the equation takes the form in terms of a new variable and some constant expression , whose roots are then .
By substituting into , expanding the products and combining like terms, and then solving for , we have:
Finally, after taking a square root of both sides and substituting the resulting expression for back into the familiar quadratic formula emerges:
By using algebraic identities
The following method was used by many historical mathematicians:
Let the roots of the quadratic equation be and . The derivation starts from an identity for the square of a difference (valid for any two complex numbers), of which we can take the square root on both sides:
Since the coefficient , we can divide the quadratic equation by to obtain a monic polynomial with the same roots. Namely,
This implies that the sum and the product . Thus the identity can be rewritten:
Therefore,
The two possibilities for each of and are the same two roots in opposite order, so we can combine them into the standard quadratic equation:
By Lagrange resolvents
An alternative way of deriving the quadratic formula is via the method of Lagrange resolvents,[Clark, A. (1984). ''Elements of abstract algebra''. Courier Corporation. p. 146.] which is an early part of Galois theory
In mathematics, Galois theory, originally introduced by Évariste Galois, provides a connection between field (mathematics), field theory and group theory. This connection, the fundamental theorem of Galois theory, allows reducing certain problems ...
.
This method can be generalized to give the roots of cubic polynomial
In mathematics, a cubic function is a function (mathematics), function of the form f(x)=ax^3+bx^2+cx+d, that is, a polynomial function of degree three. In many texts, the ''coefficients'' , , , and are supposed to be real numbers, and the func ...
s 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
In group theory, the symmetry group of a geometric object is the group of all transformations under which the object is invariant, endowed with the group operation of composition. Such a transformation is an invertible mapping of the amb ...
of their roots, the Galois group
In mathematics, in the area of abstract algebra known as Galois theory, the Galois group of a certain type of field extension is a specific group associated with the field extension. The study of field extensions and their relationship to the pol ...
.
This approach focuses on the roots themselves rather than algebraically rearranging the original equation. Given a monic quadratic polynomial assume that and are the two roots. So the polynomial factors as
which implies and .
Since multiplication and addition are both commutative
In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Perhaps most familiar as a pr ...
, exchanging the roots and will not change the coefficients and : one can say that and are symmetric polynomials in and . Specifically, they are the elementary symmetric polynomials
Elementary may refer to:
Arts, entertainment, and media Music
* Elementary (Cindy Morgan album), ''Elementary'' (Cindy Morgan album), 2001
* Elementary (The End album), ''Elementary'' (The End album), 2007
* ''Elementary'', a Melvin "Wah-Wah Watso ...
– any symmetric polynomial in and can be expressed in terms of and instead.
The Galois theory approach to analyzing and solving polynomials is to ask whether, given coefficients of a polynomial each of which is a symmetric function in the roots, one can "break" the symmetry and thereby recover the roots. Using this approach, solving a polynomial of degree is related to the ways of rearranging (" permuting") terms, called the symmetric group
In abstract algebra, the symmetric group defined over any set is the group whose elements are all the bijections from the set to itself, and whose group operation is the composition of functions. In particular, the finite symmetric grou ...
on letters and denoted . For the quadratic polynomial, the only ways to rearrange two roots are to either leave them be or to transpose
In linear algebra, the transpose of a Matrix (mathematics), matrix is an operator which flips a matrix over its diagonal;
that is, it switches the row and column indices of the matrix by producing another matrix, often denoted by (among other ...
them, so solving a quadratic polynomial is simple.
To find the roots and , consider their sum and difference:
These are called the ''Lagrange resolvents'' of the polynomial, from which the roots can be recovered as
Because is a symmetric function in and , it can be expressed in terms of and specifically as described above. However, is not symmetric, since exchanging and yields the additive inverse . So cannot be expressed in terms of the symmetric polynomials. However, its square ''is'' symmetric in the roots, expressible in terms of and . Specifically , which implies . Taking the positive root "breaks" the symmetry, resulting in
from which the roots and are recovered as
which is the quadratic formula for a monic polynomial.
Substituting , yields the usual expression for an arbitrary quadratic polynomial. The resolvents can be recognized as
respectively the vertex and the discriminant of the monic polynomial.
A similar but more complicated method works for cubic equation
In algebra, a cubic equation in one variable is an equation of the form
ax^3+bx^2+cx+d=0
in which is not zero.
The solutions of this equation are called roots of the cubic function defined by the left-hand side of the equation. If all of th ...
s, which have three resolvents and a quadratic equation (the "resolving polynomial") relating and , which one can solve by the quadratic equation, and similarly for a quartic equation ( degree 4), whose resolving polynomial is a cubic, which can in turn be solved.[ The same method for a ]quintic equation
In mathematics, a quintic function is a function of the form
:g(x)=ax^5+bx^4+cx^3+dx^2+ex+f,\,
where , , , , and are members of a field, typically the rational numbers, the real numbers or the complex numbers, and is nonzero. In other word ...
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.
Numerical calculation
The quadratic formula is exactly correct when performed using the idealized arithmetic of real number
In mathematics, a real number is a number that can be used to measure a continuous one- dimensional quantity such as a duration or temperature. Here, ''continuous'' means that pairs of values can have arbitrarily small differences. Every re ...
s, but when approximate arithmetic is used instead, for example pen-and-paper arithmetic carried out to a fixed number of decimal places or the floating-point
In computing, floating-point arithmetic (FP) is arithmetic on subsets of real numbers formed by a ''significand'' (a Sign (mathematics), signed sequence of a fixed number of digits in some Radix, base) multiplied by an integer power of that ba ...
binary arithmetic available on computers, the limitations of the number representation can lead to substantially inaccurate results unless great care is taken in the implementation. Specific difficulties include catastrophic cancellation in computing the sum if ; catastrophic calculation in computing the discriminant itself in cases where ; degeneration of the formula when , , or is represented as zero or infinite; and possible overflow or underflow when multiplying or dividing extremely large or small numbers, even in cases where the roots can be accurately represented.
Catastrophic cancellation occurs when two numbers which are approximately equal are subtracted. While each of the numbers may independently be representable to a certain number of digits of precision, the identical leading digits of each number cancel, resulting in a difference of lower relative precision. When , evaluation of causes catastrophic cancellation, as does the evaluation of when . When using the standard quadratic formula, calculating one of the two roots always involves addition, which preserves the working precision of the intermediate calculations, while calculating the other root involves subtraction, which compromises it. Therefore, naïvely following the standard quadratic formula often yields one result with less relative precision than expected. Unfortunately, introductory algebra textbooks typically do not address this problem, even though it causes students to obtain inaccurate results in other school subjects such as introductory chemistry.
For example, if trying to solve the equation using a pocket calculator, the result of the quadratic formula might be approximately calculated as:
Even though the calculator used ten decimal digits of precision for each step, calculating the difference between two approximately equal numbers has yielded a result for with only four correct digits.
One way to recover an accurate result is to use the identity . In this example can be calculated as , which is correct to the full ten digits. Another more or less equivalent approach is to use the version of the quadratic formula with the square root in the denominator to calculate one of the roots (see above).
Practical computer implementations of the solution of quadratic equations commonly choose which formula to use for each root depending on the sign of .
These methods do not prevent possible overflow or underflow of the floating-point exponent in computing or , which can lead to numerically representable roots not being computed accurately. A more robust but computationally expensive strategy is to start with the substitution , turning the quadratic equation into
where is the sign function
In mathematics, the sign function or signum function (from '' signum'', Latin for "sign") is a function that has the value , or according to whether the sign of a given real number is positive or negative, or the given number is itself zer ...
. Letting , this equation has the form , for which one solution is and the other solution is . The roots of the original equation are then and .
With additional complication the expense and extra rounding of the square roots can be avoided by approximating them as powers of two, while still avoiding exponent overflow for representable roots.
Historical development
The earliest methods for solving quadratic equations were geometric. Babylonian cuneiform tablets contain problems reducible to solving quadratic equations. The Egyptian Berlin Papyrus, dating back to the Middle Kingdom (2050 BC to 1650 BC), contains the solution to a two-term quadratic equation.
The Greek mathematician Euclid
Euclid (; ; BC) was an ancient Greek mathematician active as a geometer and logician. Considered the "father of geometry", he is chiefly known for the '' Elements'' treatise, which established the foundations of geometry that largely domina ...
(circa 300 BC) used geometric methods to solve quadratic equations in Book 2 of his '' Elements'', an influential mathematical treatise Rules for quadratic equations appear in the Chinese '' The Nine Chapters on the Mathematical Art'' circa 200 BC. In his work ''Arithmetica
Diophantus of Alexandria () (; ) was a Greek mathematics, Greek mathematician who was the author of the ''Arithmetica'' in thirteen books, ten of which are still extant, made up of arithmetical problems that are solved through algebraic equations ...
'', the Greek mathematician Diophantus
Diophantus of Alexandria () (; ) was a Greek mathematician who was the author of the '' Arithmetica'' in thirteen books, ten of which are still extant, made up of arithmetical problems that are solved through algebraic equations.
Although Jose ...
(circa 250 AD) solved quadratic equations with a method more recognizably algebraic than the geometric algebra of Euclid. His solution gives only one root, even when both roots are positive.
The Indian mathematician Brahmagupta
Brahmagupta ( – ) was an Indian Indian mathematics, mathematician and Indian astronomy, astronomer. He is the author of two early works on mathematics and astronomy: the ''Brāhmasphuṭasiddhānta'' (BSS, "correctly established Siddhanta, do ...
included a generic method for finding one root of a quadratic equation in his treatise '' Brāhmasphuṭasiddhānta'' (circa 628 AD), written out in words in the style of that time.[Bradley, Michael. ''The Birth of Mathematics: Ancient Times to 1300'', p. 86 (Infobase Publishing 2006).] His solution of the quadratic equation was as follows: "To the absolute number multiplied by four times the oefficient of thesquare, add the square of the oefficient of themiddle term; the square root of the same, less the oefficient of themiddle term, being divided by twice the oefficient of thesquare is the value."
In modern notation, this can be written . The Indian mathematician Śrīdhara (8th–9th century) came up with a similar algorithm for solving quadratic equations in a now-lost work on algebra quoted by Bhāskara II. The modern quadratic formula is sometimes called ''Sridharacharya's formula'' in India and ''Bhaskara's formula'' in Brazil.
The 9th-century Persian mathematician Muḥammad ibn Mūsā al-Khwārizmī solved quadratic equations algebraically. The quadratic formula covering all cases was first obtained by Simon Stevin
Simon Stevin (; 1548–1620), sometimes called Stevinus, was a County_of_Flanders, Flemish mathematician, scientist and music theorist. He made various contributions in many areas of science and engineering, both theoretical and practical. He a ...
in 1594. In 1637 René Descartes
René Descartes ( , ; ; 31 March 1596 – 11 February 1650) was a French philosopher, scientist, and mathematician, widely considered a seminal figure in the emergence of modern philosophy and Modern science, science. Mathematics was paramou ...
published '' La Géométrie'' containing special cases of the quadratic formula in the form we know today.
Geometric significance
In terms of coordinate geometry, an axis-aligned parabola is a curve whose -coordinates are the graph of a second-degree polynomial, of the form , where , , and are real-valued constant coefficients with .
Geometrically, the quadratic formula defines the points on the graph, where the parabola crosses the -axis. Furthermore, it can be separated into two terms,
The first term describes the axis of symmetry, the line . The second term, , gives the distance the roots are away from the axis of symmetry.
If the parabola's vertex is on the -axis, then the corresponding equation has a single repeated root on the line of symmetry, and this distance term is zero; algebraically, the discriminant .
If the discriminant is positive, then the vertex is not on the -axis but the parabola opens in the direction of the -axis, crossing it twice, so the corresponding equation has two real roots. If the discriminant is negative, then the parabola opens in the opposite direction, never crossing the -axis, and the equation has no real roots; in this case the two complex-valued roots will be complex conjugate
In mathematics, the complex conjugate of a complex number is the number with an equal real part and an imaginary part equal in magnitude but opposite in sign. That is, if a and b are real numbers, then the complex conjugate of a + bi is a - ...
s whose real part is the value of the axis of symmetry.
Dimensional analysis
If the constants , , and/or are not unitless then the quantities and must have the same units, because the terms and agree on their units. By the same logic, the coefficient must have the same units as , irrespective of the units of . This can be a powerful tool for verifying that a quadratic expression of physical quantities
A physical quantity (or simply quantity) is a property of a material or system that can be quantified by measurement. A physical quantity can be expressed as a ''value'', which is the algebraic multiplication of a '' numerical value'' and a '' ...
has been set up correctly.
See also
* Fundamental theorem of algebra
The fundamental theorem of algebra, also called d'Alembert's theorem or the d'Alembert–Gauss theorem, states that every non-constant polynomial, constant single-variable polynomial with Complex number, complex coefficients has at least one comp ...
* Vieta's formulas
In mathematics, Vieta's formulas relate the coefficients of a polynomial to sums and products of its roots. They are named after François Viète (1540-1603), more commonly referred to by the Latinised form of his name, "Franciscus Vieta."
Basi ...
Notes
References
*
*
{{Polynomials
Elementary algebra
Equations