A quadratic equation whose
coefficients are
real numbers can have either zero, one, or two distinct real-valued solutions, also called
roots. When there is only one distinct root, it can be interpreted as two roots with the same value, called a
double root. When there are no real roots, the coefficients can be considered as
complex numbers with zero
imaginary part, and the quadratic equation still has two complex-valued roots,
complex conjugates of each-other with a non-zero imaginary part. A quadratic equation whose coefficients are arbitrary complex numbers always has two complex-valued roots which may or may not be distinct. The solutions of a quadratic equation can be found by several alternative methods.
Factoring by inspection It may be possible to express a quadratic equation as a product . In some cases, it is possible, by simple inspection, to determine values of
p,
q,
r, and
s that make the two forms equivalent to one another. If the quadratic equation is written in the second form, then the "Zero Factor Property" states that the quadratic equation is satisfied if or . Solving these two linear equations provides the roots of the quadratic. For most students, factoring by inspection is the first method of solving quadratic equations to which they are exposed. If one is given a quadratic equation in the form , the sought factorization has the form , and one has to find two numbers and that add up to and whose product is (this is sometimes called "Vieta's rule" and is related to
Vieta's formulas). As an example, factors as . The more general case where does not equal can require a considerable effort in trial and error guess-and-check, assuming that it can be factored at all by inspection. Except for special cases such as where or , factoring by inspection only works for quadratic equations that have rational roots. This means that the great majority of quadratic equations that arise in practical applications cannot be solved by factoring by inspection.
Quadratic formula and its derivation Completing the square can be used to
derive a general formula for solving quadratic equations, called the quadratic formula. where has a magnitude one half of the more common one, possibly with opposite sign. These result in slightly different forms for the solution, but are otherwise equivalent. A number of
alternative derivations can be found in the literature. These proofs are simpler than the standard completing the square method, represent interesting applications of other frequently used techniques in algebra, or offer insight into other areas of mathematics. A lesser known quadratic formula, as used in
Muller's method, provides the same roots via the equation x = \frac{2c}{-b \pm \sqrt {b^2-4ac}}. This can be deduced from the standard quadratic formula by
Vieta's formulas, which assert that the product of the roots is . It also follows from dividing the quadratic equation by x^2 giving cx^{-2}+bx^{-1}+a=0, solving this for x^{-1}, and then inverting. One property of this form is that it yields one valid root when , while the other root contains division by zero, because when , the quadratic equation becomes a linear equation, which has one root. By contrast, in this case, the more common formula has a division by zero for one root and an
indeterminate form for the other root. On the other hand, when , the more common formula yields two correct roots whereas this form yields the zero root and an indeterminate form . When neither nor is zero, the equality between the standard quadratic formula and Muller's method, \frac{2c}{-b - \sqrt {b^2-4ac}} = \frac{-b + \sqrt {b^2-4ac}}{2a}\,, can be verified by
cross multiplication, and similarly for the other choice of signs.
Reduced quadratic equation It is sometimes convenient to reduce a quadratic equation so that its
leading coefficient is one. This is done by dividing both sides by , which is always possible since is non-zero. This produces the
reduced quadratic equation: x^2+px+q=0, where and . This
monic polynomial equation has the same solutions as the original. The quadratic formula for the solutions of the reduced quadratic equation, written in terms of its coefficients, is x = - \frac{p}{2} \pm \sqrt{\left(\frac{p}{2}\right)^2 - q}\,.
Discriminant In the quadratic formula, the expression underneath the square root sign is called the
discriminant of the quadratic equation, and is often represented using an upper case or an upper case Greek
delta: \Delta = b^2 - 4ac. A quadratic equation with
real coefficients can have either one or two distinct real roots, or two distinct complex roots. In this case the discriminant determines the number and nature of the roots. There are three cases: • If the discriminant is positive, then there are two distinct roots \frac{-b + \sqrt {\Delta}}{2a} \quad\text{and}\quad \frac{-b - \sqrt {\Delta}}{2a}, both of which are real numbers. For quadratic equations with
rational coefficients, if the discriminant is a
square number, then the roots are rational—in other cases they may be
quadratic irrationals. • If the discriminant is zero, then there is exactly one
real root -\frac{b}{2a}, sometimes called a repeated or
double root or two equal roots. • If the discriminant is negative, then there are no real roots. Rather, there are two distinct (non-real)
complex roots -\frac{b}{2a} + i \frac{\sqrt {-\Delta}}{2a} \quad\text{and}\quad -\frac{b}{2a} - i \frac{\sqrt {-\Delta}}{2a}, which are
complex conjugates of each other. In these expressions is the
imaginary unit. Thus the roots are distinct if and only if the discriminant is non-zero, and the roots are real if and only if the discriminant is non-negative.
Geometric interpretation The function is a
quadratic function. The graph of any quadratic function has the same general shape, which is called a
parabola. The location and size of the parabola, and how it opens, depend on the values of , , and . If , the parabola has a
minimum point and opens upward. If , the parabola has a maximum point and opens downward. The extreme point of the parabola, whether minimum or maximum, corresponds to its
vertex. The
-coordinate of the vertex will be located at \scriptstyle x=\tfrac{-b}{2a}, and the
-coordinate of the vertex may be found by substituting this
-value into the function. The
-intercept is located at the point . The solutions of the quadratic equation correspond to the
roots of the function , since they are the values of for which . If , , and are
real numbers and the
domain of is the set of real numbers, then the roots of are exactly the -
coordinates of the points where the graph touches the -axis. If the discriminant is positive, the graph touches the
-axis at two points; if zero, the graph touches at one point; and if negative, the graph does not touch the -axis.
Quadratic factorization The term x - r is a factor of the polynomial ax^2+bx+c if and only if is a
root of the quadratic equation ax^2+bx+c=0. It follows from the quadratic formula that ax^2+bx+c = a \left( x - \frac{-b + \sqrt {b^2-4ac}}{2a} \right) \left( x - \frac{-b - \sqrt {b^2-4ac}}{2a} \right). In the special case where the quadratic has only one distinct root (
i.e. the discriminant is zero), the quadratic polynomial can be
factored as ax^2+bx+c = a \left( x + \frac{b}{2a} \right)^2.
Graphical solution The solutions of the quadratic equation ax^2+bx+c=0 may be obtained from the
graph of the
quadratic function f(x)=ax^2+bx+c, which is a
parabola. If the parabola intersects the -axis in two points, there are two real
roots, which are the -coordinates of these two points (also called -intercept). If the parabola is
tangent to the -axis, there is a double root, which is the -coordinate of the contact point between the graph and parabola. If the parabola does not intersect the -axis, there are two
complex conjugate roots. Although these roots cannot be visualized on the graph, their
real and imaginary parts can be. Let and be respectively the -coordinate and the -coordinate of the vertex of the parabola (that is the point with maximal or minimal -coordinate. The quadratic function may be rewritten y = a(x - h)^2 + k. Let be the distance between the point of -coordinate on the axis of the parabola, and a point on the parabola with the same -coordinate (see the figure; there are two such points, which give the same distance, because of the symmetry of the parabola). Then the real part of the roots is , and their imaginary part are . That is, the roots are h+id \quad \text{and} \quad h-id, or in the case of the example of the figure 5+3i \quad \text{and} \quad 5-3i.
Avoiding loss of significance Although the quadratic formula provides an exact solution, the result is not exact if
real numbers are approximated during the computation, as usual in
numerical analysis, where real numbers are approximated by
floating point numbers (called "reals" in many
programming languages). In this context, the quadratic formula is not completely
stable. This occurs when the roots have different
order of magnitude, or, equivalently, when and are close in magnitude. In this case, the subtraction of two nearly equal numbers will cause
loss of significance or
catastrophic cancellation in the smaller root. To avoid this, the root that is smaller in magnitude, , can be computed as (c/a)/R where is the root that is bigger in magnitude. This is equivalent to using the formula x =\frac{-2c}{b \pm \sqrt {b^2-4ac}} using the plus sign if b>0 and the minus sign if b A second form of cancellation can occur between the terms and of the discriminant, that is when the two roots are very close. This can lead to loss of up to half of correct significant figures in the roots. ==Examples and applications==