Quadratic Formula Calculator
Solve ax² + bx + c = 0 with the quadratic formula: exact roots, discriminant, vertex, graph and steps.
Type any equation in x to get the answer with steps. Linear, quadratic and polynomial equations such as are solved exactly, using for quadratics.
Solution
x = 4 is the only value that makes both sides equal: each side equals 17 there.
| # | x | Left side f(x) | Right side g(x) | |f(x) − g(x)| |
|---|---|---|---|---|
| 1 | 4 | 17 | 17 | 0 |
Collect the x terms on the left
Subtract from both sides.
Move the constant to the right
Add to both sides.
Divide both sides by 3
Check by substitution
Putting x = 4 into both sides gives 17 on each side.
Others, such as , are solved numerically and graphed.
5x - 3 = 2x + 9, x^2 - 5x + 6 = 0 or cos(x) = x. You may start with "solve for x:". Without an = sign, the expression is solved as f(x) = 0.3x or 3*x, powers as x^2, and functions as sqrt(x), ln(x), e^x or sin(x). On a phone, the buttons under the box insert x², √, π and parentheses.Linear equation with x on both sides
Plain-text formula: ax + b = cx + d ⇒ (a − c)x = d − b ⇒ x = (d − b)/(a − c)
Collect the x terms on one side and the constants on the other, then divide by the coefficient of x. If a = c the x terms cancel: the equation holds for every x when b = d and has no solution otherwise.
Quadratic formula
Plain-text formula: ax^2 + bx + c = 0 ⇒ x = (−b ± √(b^2 − 4ac))/(2a)
The discriminant b² − 4ac decides the case: positive gives two real solutions, zero gives one repeated solution, negative gives two complex solutions. Cubic and higher polynomial equations are factored with the rational root theorem first.
Numerical root finding on an interval
Plain-text formula: h(x) = f(x) − g(x), h(x_i) h(x_(i + 1)) < 0 ⇒ a root lies in (x_i, x_(i + 1))
For equations that are not polynomials, the interval is split into 4,000 pieces. If the continuous function h changes sign across a piece, it has a zero there (the intermediate value theorem), and Brent’s method narrows it down by combining safe bisection with fast secant and inverse quadratic interpolation steps.
Residual
Plain-text formula: r = |f(x^∗) − g(x^∗)|
Substituting a computed root back into both sides measures how well it solves the equation. Values around 10⁻¹⁵ to 10⁻¹² are normal floating-point rounding.
For linear, quadratic and polynomial equations, the answer at the top is exact. Fractions and square roots are kept, and the answer covers every real number, not just the graph range. If a quadratic part has no real roots, its complex solutions are listed. The table and graph check each real solution in the range.
For other equations, the answer is numerical and covers only the range you give. An empty result means no root was found there, not that none exists. Two roots very close together can be missed, and so can a root where the graph only touches the axis. Vertical asymptotes, as in or , are never reported as roots. If the graph shows a root that is missing, narrow the range around it.
Decimal roots are shown to 10 significant digits. The residual |f(x) − g(x)| shows how closely the two sides agree at each root.
An equation such as has x on both sides. The goal is to get every x term on one side and every constant on the other. Do the same thing to both sides at each step, so the equation stays balanced.
First expand any parentheses and combine like terms on each side. Then subtract the smaller x term from both sides: taking away gives . Next move the constant: adding 3 to both sides gives . Finally divide by the coefficient of x to get , and check by substitution: and .
Two special cases appear when the x terms cancel. If what is left is true, as in , which leaves , every real number is a solution (an identity). If it is false, as in , which leaves , there is no solution. The solver shows the step where the x terms cancel and names the case. For more practice, follow the guide to solving a linear equation.
Exactly, with steps: linear equations with fractions, decimals and parentheses; quadratic equations with real or complex solutions; and polynomial equations up to degree 6, factored with the rational root theorem.
Numerically: any other equation in one variable, such as , or , on an interval you choose.
Elsewhere on the site: two or more equations with several unknowns go to the system of equations calculator, inequalities to the inequality calculator, and equations in other letters, derivatives or integrals to the step-by-step math solver.
Many equations that mix different kinds of functions, such as or , cannot be solved with algebra alone: no rearrangement isolates x. Their solutions still exist and can be computed to full precision numerically. The solution of , about 0.7390851332, even has a name: the Dottie number.
For on the interval from −10 to 10, the solver finds two sign changes and refines them to x ≈ 0.4578223732 and x ≈ 3.31317838. At the second root both sides equal about 9.939535141. The graphing calculator shows the same intersections interactively, and the guide to solving any equation explains how to choose a good interval.
Solve 3(x + 2) = 5x − 4 for x. The equation has parentheses and x on both sides.
Answer: The solution is x = 5. The graphs of y = 3(x + 2) and y = 5x − 4 cross at the point (5, 21).
Yes. It is free with no sign-up, the steps are never behind a paywall, and there is no limit on how many equations you solve. The calculation runs in your browser.
Yes. Linear equations are solved the way you would by hand: expand, collect the x terms, move the constants and divide. Quadratics use the discriminant and the quadratic formula, higher polynomials are factored, and for numerical equations the steps explain the search and the check.
Move every x term to one side and every constant to the other by adding or subtracting the same amount on both sides, then divide by the coefficient of x. For , subtract to get , add 3 to get , and divide by 3 to get .
This page uses x only. To solve for y, t or another letter, or to rearrange an equation with two variables, use the step-by-step math solver, which accepts input such as "solve for y: 2x + 3y = 6".
Yes, for polynomial equations. For example, gives and . Equations that are not polynomials are solved over the real numbers only.
This can happen with numerical equations when two roots lie within one sampling step of each other, or the graph only touches the axis without crossing it. Narrow the interval around the root (for example from 1.9 to 2.1) so the step becomes much smaller, and run it again.
Radians by default. Switch the angle unit to degrees for equations such as sin x = 0.5 meant in degrees, which then gives x = 30 and x = 150 between 0 and 360.
Solve ax² + bx + c = 0 with the quadratic formula: exact roots, discriminant, vertex, graph and steps.
Solve linear systems in 2 to 4 unknowns with exact row operations, a graph and a check.
Linear, compound, absolute-value, quadratic and rational inequalities solved step by step.
All real and complex roots of a polynomial up to degree 10, with multiplicities, exact forms and steps.
Plot functions, equations, inequalities, parametric and polar curves; find roots and intersections.
Free worked solutions for equations, systems, inequalities, factoring, derivatives, integrals, limits and matrices.
Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?