A quadratic equation is an equation that, after collecting terms, can be written as
Here is the unknown, and , , and are fixed coefficients. In its usual elementary setting, the coefficients are real numbers, although quadratic equations can also be studied over the complex numbers and other number systems. A quadratic equation has at most two distinct roots over a field, and exactly two complex roots when repeated roots are counted according to multiplicity.
Quadratic equations occupy a central position in algebra because they are the simplest polynomial equations whose solutions require more than linear operations. Their study connects symbolic calculation with geometry, introduces irrational and complex solutions, and supplies methods used in physics, optimization, numerical computation, and number theory. Procedures equivalent to solving quadratics were known in ancient Mesopotamia; the modern formula emerged through a long development involving geometric reasoning, arithmetic algorithms, and symbolic notation.
Definition, standard forms, and equivalent equations
The defining feature of a quadratic equation in one unknown is the presence of a nonzero squared term and the absence of higher powers after simplification. The expression is a polynomial of degree two. The coefficient is its leading coefficient, is its linear coefficient, and is its constant term. The restriction is essential: if , the equation is linear when , inconsistent when and , and satisfied by every possible value of when all three coefficients vanish.
An equation need not initially appear in standard form to be quadratic. For example,
becomes . Conversely, an equation containing squares may cease to be quadratic after cancellation:
reduces to . Degree therefore refers to the simplified polynomial equation, not merely to the highest exponent visible in an unsimplified expression.
Dividing by gives the monic form
Multiplication of an equation by a nonzero constant does not change its solution set. Thus and describe the same roots, even though their coefficients differ. Translating the unknown can simplify the equation further: setting , when division by is permitted, removes the linear term and produces an equation involving only and a constant.
If the roots are and , the equation can be expressed in factored form:
If the coefficients are real, a particularly useful alternative is vertex form:
These forms encode different information: standard form records the coefficients, factored form displays the roots, and vertex form locates the turning point of the associated graph.
A solution, or root, is a value that makes the equation true upon substitution. The allowed number system matters. The equation has no rational root but has two irrational real roots. The equation has no real root but has the complex roots and . Solving an equation therefore includes specifying both its algebraic form and the domain in which solutions are sought.
Factoring, completing the square, and the quadratic formula
Several solution methods exploit different representations of the same polynomial. Factoring is especially efficient when simple factors are apparent. For example,
Over the real or complex numbers, a product is zero only if at least one factor is zero, so the roots are and . This zero-product principle is also valid in any integral domain, but not in every algebraic system. Factoring by inspection is convenient rather than universal: many quadratics do not factor into linear expressions with integer or rational coefficients.
When the linear term is absent, direct extraction of square roots is sufficient:
Both signs must be included when the right-hand side is a positive real number. Thus yields , not only . The square-root symbol denotes the nonnegative square root, whereas the equation asks for every value whose square equals .
The general method of completing the square transforms a quadratic into this simpler situation. Dividing the standard equation by and moving the constant gives
Adding the square of half the linear coefficient to both sides yields
Equivalently, without first normalizing the coefficient of ,
Taking both square-root branches and solving for produces the quadratic formula:
For real coefficients with a negative quantity under the square root, the same expression is interpreted using complex numbers.
For example, completing the square in
gives
and hence
The formula gives the same result directly. Completing the square exposes the transformation underlying the formula, while the formula packages those operations into a reusable expression.
Care is required when an equation is transformed before applying these methods. Adding the same expression to both sides and multiplying by a known nonzero constant preserve equivalence. Dividing by an expression involving can discard solutions where that expression vanishes. Squaring both sides can introduce additional solutions. For instance, a quadratic obtained from a radical equation may have roots that fail the original equation. Substitution into the original statement, rather than only its transformed polynomial, distinguishes genuine solutions from artifacts of the calculation.
The discriminant and the nature of the roots
The quantity
is the discriminant of a quadratic polynomial. For real coefficients, its sign completely determines the number of distinct real roots. If , the equation has two distinct real roots. If , it has one repeated real root, . If , it has no real roots and two nonreal complex roots. This classification follows immediately from completing the square, since the square of a real number cannot be negative.
A repeated root has multiplicity two: the polynomial is then
It is one distinct solution, but it is counted twice when roots are counted with multiplicity. This distinction makes the statement “a quadratic has two roots” precise. Over the complex numbers, every quadratic has two roots counted with multiplicity, a special case of the fundamental theorem of algebra. Over the real numbers, the count of distinct solutions can instead be zero, one, or two.
For integer coefficients, the discriminant also determines whether the roots are rational. They are rational exactly when is a nonnegative perfect square. Indeed, if an integer has a rational square root, that square root must be an integer. Thus
has and roots and , whereas has and irrational roots . Rational roots need not be integers when the polynomial is not monic.
For , the roots can be written
They form a complex-conjugate pair: they have equal real parts and opposite imaginary parts. More generally, a polynomial with real coefficients takes conjugate values at conjugate inputs, so a nonreal root must occur together with its conjugate. For example, has roots and .
The discriminant also describes how roots merge as coefficients change. In the family
the roots are . They are distinct and real for , coincide at , and become nonreal for . Their separation for real distinct roots is
Multiplying all coefficients by a nonzero real number multiplies by its square. Its numerical value changes, but its sign and the resulting classification of the roots remain unchanged.
Graphs, parabolas, and quadratic inequalities
A real quadratic equation is closely associated with the function
Its graph is a parabola, one of the classical conic sections. Solving finds the horizontal coordinates of its intersections with the horizontal axis. Two intersections correspond to a positive discriminant, tangency to a zero discriminant, and no intersection to a negative discriminant. This picture gives a geometric interpretation of the algebraic classification without replacing the need for exact calculation.
Writing
identifies the vertex as , where
The vertical line is the axis of symmetry. If , the parabola opens upward and is its minimum value; if , it opens downward and is its maximum. The parameter controls the vertical scaling relative to , while and describe horizontal and vertical translations.
In calculus, the same vertex follows from the derivative:
The derivative vanishes only at , and the second derivative is the constant . Thus the graphical turning point, the algebraic completion of the square, and the calculus condition for a stationary point all identify the same location. When two real roots exist, their midpoint is the horizontal coordinate of the vertex.
The graph also organizes solutions of quadratic inequalities. Suppose and the two roots satisfy . Then
exactly when ; the expression is positive outside that interval. If , these signs reverse. When the discriminant is negative, the polynomial never vanishes and always has the sign of . When the discriminant is zero, its sign is again that of , except at the repeated root where it is zero. Non-strict inequalities include the relevant endpoints.
Quadratic equations also arise from intersections of curves in analytic geometry. Substituting a line into a circle
produces
The discriminant determines whether the line crosses the circle twice, is tangent, or misses it. This example illustrates why quadratics occur in geometric problems even when neither original relation is presented as a one-variable polynomial equation.
Relations between roots and coefficients
The roots of a quadratic are linked to its coefficients by Vieta’s formulas. Expanding
and comparing coefficients gives
These identities hold for real or complex roots, including repeated roots. They allow information about the roots to be obtained without explicitly evaluating a square root and provide useful checks on a calculated solution.
The signs of real roots can often be classified immediately. If , their product is negative, so one root is positive and the other negative; in this case real coefficients necessarily give a positive discriminant. If the roots are real and , they have the same sign, determined by their sum . If , one root is zero and the other is . Such arguments are especially useful in applications where only positive values are meaningful.
The formulas can also be used in reverse. Given two desired roots and , a monic quadratic having them as roots is
For example, roots and have sum and product , so they satisfy . The irrational parts cancel from the coefficients. Similarly, a conjugate pair , with real and , produces
Many symmetric expressions in the roots can be calculated from their sum and product. If and , then
When , the sum of the reciprocals is . More generally, the power sums satisfy the recurrence relation
This follows because each root satisfies .
For integer coefficients, rational roots face an additional arithmetic restriction. If is a root written in lowest terms, then divides and divides . This is the quadratic case of the rational root theorem. In particular, every rational root of a monic polynomial with integer coefficients is an integer. These divisibility conditions explain why systematic trials of factors can work well for some quadratics but cannot produce rational solutions when the discriminant is not a perfect square.
Historical development
Procedures equivalent to solving quadratic equations appear in Old Babylonian mathematical texts from the early second millennium BCE. These problems were expressed in words and numerical instructions rather than modern algebraic symbols. A typical task involved finding the dimensions of a rectangle from its area and a relation between its sides. The tablet commonly designated BM 13901 contains problems that, in modern notation, involve a square and its side. Its procedures include operations recognizable as halving a coefficient, squaring the result, adding a quantity, and extracting a square root.
These ancient procedures should not be treated as direct copies of the modern formula. The unknowns commonly represented lengths or areas, and positive numerical answers had a privileged role. Nevertheless, the underlying arithmetic is closely related to completing the square. Mesopotamian computation used a sexagesimal place-value system, making tables of squares, reciprocals, and related quantities important aids to calculation.
In ancient Greek mathematics, relationships now written algebraically were frequently expressed through geometric constructions. Book II of Euclid’s Elements, compiled around 300 BCE, contains propositions relating squares and rectangles that can be translated into identities used in completing the square. The historical distinction matters: a geometric proposition about areas is not itself a symbolic quadratic equation, even when it provides a mathematically equivalent relationship. Greek geometric methods also linked such problems to the construction of lengths.
Indian mathematicians developed arithmetic rules for quadratic problems within a broader treatment of positive and negative quantities. Brahmagupta, in the Brāhmasphuṭasiddhānta of 628 CE, gave a rule equivalent to a quadratic solution formula for an equation expressed in the conventions of his text. Bhāskara II’s Bījagaṇita, written in the twelfth century, further developed algebraic methods and discussed quadratic problems. Historical treatments varied in their handling and interpretation of negative solutions; the modern practice of retaining all roots in a specified number system emerged gradually.
Around 820 CE, al-Khwarizmi presented a systematic treatment of linear and quadratic equations in his book on al-jabr and al-muqābala. Because coefficients and quantities were treated as positive, he separated quadratics into several forms rather than writing one equation with signed coefficients. His demonstrations included geometric justifications for completing the square.
The development of symbolic algebra in Renaissance and early modern Europe made a unified treatment increasingly practical. François Viète’s work in the late sixteenth century advanced the use of letters for known and unknown quantities, while René Descartes’s La Géométrie of 1637 helped establish influential notational conventions. The familiar compact formula was thus the outcome of a long synthesis, not a single isolated invention.
Numerical computation and stability
Although the quadratic formula is exact symbolically, its direct evaluation can be unreliable in floating-point arithmetic. The principal difficulty is subtractive cancellation: subtracting nearly equal approximate numbers can destroy much of the relative accuracy of the result. This occurs in one branch of
when the square root is close to . The other branch may remain accurate, so the two roots can have very different computational errors despite being obtained from the same formula.
For example,
has one root close to and another close to . The smaller root is expressed directly as
The two quantities in the numerator are extremely close. Rounding errors in the square root are therefore large relative to their difference, and a naive calculation can return a poor approximation to the small root even when the large root is accurately computed.
For real coefficients with , a common more stable method computes
taking for this algorithm. The roots are then obtained as
The sign is chosen so that the addition defining does not subtract nearly equal magnitudes. The second root follows from their known product . The case must be handled separately; it occurs here when , giving the double root zero.
Robust implementations must also consider overflow and underflow. Forming or can exceed the representable range even when the roots themselves are representable. Scaling all coefficients by a common nonzero factor preserves the roots and can reduce these risks. Computing a discriminant near zero requires particular care because rounding can affect its apparent sign. Higher precision or error-aware evaluation may be needed when distinguishing a repeated root from two very close roots is important.
These algorithmic issues are distinct from the inherent conditioning of the problem. At a simple root , small coefficient changes give, to first order,
The denominator approaches zero as roots merge. A repeated root can split by an amount proportional to the square root of a small perturbation. Numerical stability can limit avoidable computational error, but no algorithm can make an intrinsically sensitive root insensitive to uncertain coefficients.
Applications in physics, optimization, and linear systems
Quadratic equations arise whenever a quantity depends on the square of another quantity or when two linear dependences are multiplied. In classical mechanics, motion along a vertical axis under a constant gravitational acceleration is modeled by
where and upward displacement is positive. Finding when the object reaches a specified height requires solving a quadratic in time. Two real roots can represent passage through the same height on ascent and descent, but negative times may lie outside the interval described by the physical experiment.
For a projectile launched upward from height , the time at which it reaches ground level is, under this model,
The other algebraic root is usually negative, except in boundary cases. The quadratic equation alone does not encode the intended starting time or all physical restrictions. Air resistance, a varying gravitational field, or collisions can invalidate the constant-acceleration model and require different equations.
In mathematical optimization, a one-variable quadratic objective
has an unconstrained minimum at when . If , that point is a maximum. For a rectangle of fixed perimeter , writing its sides as and gives the area
Completing the square shows that the maximum occurs at , so the rectangle is a square. If a particular target area is specified instead, finding the permitted side lengths becomes a quadratic equation.
A similar structure occurs in an elementary revenue model. If price depends linearly on quantity, with , then revenue is
A target revenue produces a quadratic equation, while the vertex determines the maximum within the model. Restrictions such as , nonnegative price, and the range over which linear demand is assumed remain separate from the algebra.
Quadratics also govern important linear systems. For a two-by-two matrix , the characteristic polynomial is
Its roots are the eigenvalues of . A real matrix may therefore have either real eigenvalues or a complex-conjugate pair, according to the discriminant.
Likewise, the constant-coefficient differential equation
leads, through a trial solution , to . For a mass–spring system with and , the sign of distinguishes overdamped, critically damped, and underdamped behavior. The algebraic distinction between separated, repeated, and nonreal roots thus corresponds to different forms of motion.
Quadratic equations over other fields and rings
The usual formula depends on the algebraic setting. Over a field of characteristic different from , division by is valid, and completing the square reduces the equation to
The equation has roots in that field exactly when is a square there. A nonzero square discriminant gives two distinct roots, zero gives a repeated root, and a nonsquare gives no roots within the field. Positivity is not needed for this formulation; it is a feature specific to ordered fields such as the real numbers.
Over the rationals, a nonsquare discriminant leads naturally to a field extension containing . For example, adjoining gives the field
in which factors. This illustrates a basic idea of Galois theory: a polynomial may fail to split into linear factors over its original field but split after suitable elements are adjoined. For a quadratic with rational coefficients and no rational root, adjoining either root also supplies the other through their rational sum.
Over a finite field with an odd number of elements, the same discriminant criterion applies. In particular, modulo an odd prime , solving a quadratic can be reduced to asking whether its discriminant is a quadratic residue, meaning a square modulo . For example,
has solutions and modulo , because both squares are congruent to . It has no solution modulo , where the only square residues are and .
Characteristic requires a different treatment because , so the denominator in the familiar formula vanishes. If , the substitution transforms
into
In the finite field with elements, this equation is solvable exactly when the absolute trace of its right-hand side to the two-element field is zero; when solvable, it has two distinct roots differing by . If , the squaring map in a finite field of characteristic is bijective, giving a unique root, repeated in the polynomial factorization.
Over a general ring, even the bound of two distinct roots can fail because the zero-product principle need not hold. In arithmetic modulo , the quadratic has four distinct solutions: and . Their squares are all congruent to . Thus the familiar root count is a theorem about fields and integral domains, not an unrestricted property of every expression of degree two.