CALCULATORCASTLE

Quadratic Formula Calculator

Solve quadratic equations and find roots using the quadratic formula.

About

Quadratic Formula Calculator

In algebra, a quadratic equation is any polynomial equation of the second degree with the following form:

ax2 + bx + c = 0

where x is an unknown, a is the quadratic coefficient, b the linear coefficient and c the constant. The numerals a, b and c are the coefficients of the equation and represent known numbers. Note that a cannot be 0, or the x² term vanishes and the equation is linear rather than quadratic.

A quadratic equation can be solved several ways: by factoring, by the quadratic formula, by completing the square, or by graphing. The formula below covers every case, which is why it is the one worth memorising:

x = b ± b2 − 4ac2a

Derivation of the quadratic formula

The formula is not arbitrary. It is what you get by completing the square on the general equation once, so that nobody has to do it again for each new problem.

ax2 + bx + c = 0
Multiply by 1a
x2 + bax + ca = 0
x2 + bax =ca

From this point it is possible to complete the square using the relationship that x² + bx + c = (x − h)² + k. Continuing the derivation:

x2 + bax + (b2a)2 =ca + (b2a)2
Simplify
(x + b2a)2 =4ac4a2 + b24a2 = b2 − 4ac4a2
Square root both sides
x + b2a = ± b2 − 4ac2a
Solve for x
x = b ± b2 − 4ac2a

Recall that the ± exists as a consequence of taking a square root, which makes both the positive and negative roots solutions of the equation.

Reading the graph

The x values found through the quadratic formula are the roots of the equation, and they are exactly where the parabola y = ax² + bx + c crosses the x-axis. The formula also hands you the axis of symmetry for free: it is the line x = −b/2a, the part of the formula sitting outside the ± sign.

Graph of y = ax2 + bx + c
x y 0 c −b−√(b²−4ac) 2a −b+√(b²−4ac) 2a x = −b/2a ( −b/2a , −(b²−4ac)/4a )

The vertex sits on that axis, at the point where x = −b/2a, and the constant c is the y-intercept, since setting x to 0 leaves y = c. The sign of a decides which way the parabola opens: positive opens upward with a minimum at the vertex, negative opens downward with a maximum.

The discriminant tells you the answer before you finish

The expression under the square root, b² − 4ac, is called the discriminant, and its sign alone determines what kind of solutions exist.

When the discriminant is positive there are two distinct real roots and the parabola crosses the x-axis twice. When it is exactly zero there is one repeated root, the vertex sits on the axis, and the quadratic is a perfect square. When it is negative there are no real roots, the parabola misses the axis entirely, and the two solutions are complex conjugates of the form p ± qi.

There is a second useful test. If the discriminant is a perfect square and the coefficients are rational, the roots are rational too, which means the quadratic factors neatly and you could have solved it by factoring. If it is positive but not a perfect square, the roots are irrational and come out as surds, which is why this calculator keeps them in exact form as well as decimal.

Other routes to the same answer

Factoring is fastest when it works. Rewrite x² + 5x + 6 = 0 as (x + 2)(x + 3) = 0 and read the roots straight off as −2 and −3, since a product is zero only when one of its factors is. It fails the moment the roots stop being tidy.

Completing the square is the method the formula was built from, and it is still worth knowing because it converts the equation into vertex form, y = a(x − h)² + k, where the vertex (h, k) can be read directly. That form is what you want for optimisation problems, where the question is the maximum or minimum rather than the roots.

Vieta's formulas give a quick sanity check without solving anything. For ax² + bx + c = 0 the two roots always sum to −b/a and multiply to c/a. If your answers fail either test, the arithmetic went wrong somewhere. Trying this on x² + 2x + 1/4 = 0: the roots −0.13397459621556 and −1.8660254037844 sum to −2 and multiply to 0.25, matching −b/a and c/a exactly.

A trap in the formula that textbooks skip

The formula is exact in algebra and can behave badly in floating point. When b² is much larger than 4ac, the square root comes out very close to |b|, and one of the two numerators becomes a subtraction of two nearly equal numbers. That is catastrophic cancellation, and it can destroy most of the significant digits in the smaller root.

The fix is to compute the root of larger magnitude the usual way, then get the other from the fact that the roots multiply to c/a, which is equivalent to the alternative form 2c / (−b ∓ √(b² − 4ac)). Numerical libraries do this routinely. This calculator sidesteps the problem differently, by keeping the coefficients as exact fractions and the roots as surds, so no rounding happens until the final decimal is printed.

Where quadratics come from

Babylonian scribes were solving problems equivalent to quadratics around 2000 BC, working geometrically with areas rather than symbols, and they only ever reported positive answers because a negative length meant nothing to them. Brahmagupta gave an explicit general solution in 628 AD and was willing to accept negative numbers, which was well ahead of his contemporaries. Al-Khwarizmi set out systematic methods around 820 AD in the book whose title gave us the word algebra, still without symbolic notation. The form used today, with letters for coefficients and an equals sign, arrived with Descartes in 1637.

The applications are everywhere once the shape is recognised. Projectile motion is quadratic in time, because gravity supplies a constant acceleration, so the height of anything thrown follows a parabola and the roots are the moments it leaves and returns to ground level. Area problems produce quadratics whenever two dimensions are linked, such as fencing a rectangular plot with a fixed amount of material. Break-even analysis in business, braking distance in vehicle dynamics, and the shape of a satellite dish are all the same equation wearing different clothes.

One quadratic worth meeting is x² − x − 1 = 0. Its positive root is (1 + √5)/2, roughly 1.618, the golden ratio, which appears in the growth of the Fibonacci sequence and turns up in far more places than its reputation deserves.

Using this calculator

Enter a, b and c, and fractional values such as 3/4 can be used directly rather than being converted to decimals first. The result panel gives the discriminant, the vertex position and the roots in both exact and decimal form, and the step panel substitutes your own numbers into the formula line by line, the way you would write it out on paper. With a = 1, b = 2 and c = 1/4, the working reaches (−2 ± √3)/2, simplifies to −1 ± ½√3, and only then prints the decimals.

Common questions

Frequently asked questions

x = (−b ± √(b² − 4ac)) / 2a, which solves any equation of the form ax² + bx + c = 0. The ± produces the two roots. It works for every quadratic, including ones that cannot be factored, which is why it is worth memorising even though factoring is quicker when it applies.

Because the x² term disappears and what remains, bx + c = 0, is a linear equation with a single root at −c/b. The quadratic formula also breaks down directly: 2a becomes 0 in the denominator. The calculator rejects a = 0 rather than returning nonsense.

The sign of b² − 4ac determines the kind of solutions. Positive gives two distinct real roots and a parabola crossing the x-axis twice. Zero gives one repeated root, with the vertex sitting on the axis. Negative gives two complex conjugate roots and a parabola that never touches the axis.

Yes. Type values like 3/4 or 1/4 straight into the boxes. They are kept as exact fractions all the way through, so the discriminant and the roots stay exact instead of picking up rounding error at the first step. Decimals work too and are converted to fractions internally.

The discriminant is exactly zero, so the ± adds and subtracts nothing and both roots land on the same value, −b/2a. The quadratic is a perfect square: x² + x + 1/4 factors as (x + 1/2)², giving the repeated root −0.5. Graphically the parabola touches the x-axis at its vertex rather than crossing it.

Use the relationships between roots and coefficients. The two roots always add to −b/a and multiply to c/a. If either check fails, the arithmetic slipped. Substituting a root back into the original equation and confirming it returns 0 is the other way, though the addition and multiplication test is faster.

Rewriting ax² + bx + c into the form a(x − h)² + k, so the x appears only once and the equation can be unwound by taking a square root. It is where the quadratic formula comes from, and it also puts the equation in vertex form, which makes the maximum or minimum readable straight off as the point (h, k).

When b² − 4ac is negative, the square root of a negative number is written using i, defined by i² = −1, and the two solutions come out as a conjugate pair p ± qi. They are perfectly valid solutions and appear constantly in electrical engineering and signal processing; they simply do not correspond to points where the graph meets the x-axis.