Quadratic Equation Calculator
Quadratic Equation Calculator
A quadratic equation has the form ax² + bx + c = 0, where a, b, and c are constants and a ≠ 0. Solving it means finding the values of x that make the expression zero — the roots, or the points where the corresponding parabola crosses the x-axis [lial].
Quadratics are among the oldest equations studied, appearing in Babylonian clay tablets over three thousand years ago for problems of area and inheritance. Today they model projectile motion, the shape of satellite dishes, profit maximization in business, and the natural frequencies of mechanical systems. Whenever a quantity depends on the square of another, a quadratic is rarely far away.
This calculator solves any quadratic using the quadratic formula. It reports the discriminant (which reveals how many real roots exist), the roots themselves (real or complex), and the vertex of the parabola — the highest or lowest point of the curve. Complex roots appear when the parabola never touches the x-axis.
The quadratic formula is remarkable because it works for every quadratic, regardless of whether the roots are nice integers, messy irrationals, or genuinely complex. Before electronic calculators, students memorized it and practiced by hand; today the same formula powers engineering software, physics simulations, and financial models. Understanding the discriminant turns the formula from a mechanical recipe into a diagnostic tool: you can predict the qualitative behavior of the solutions before evaluating a single square root.
A useful way to read a quadratic is geometrically. The expression ax² + bx + c describes a parabola. The sign of a tells you whether it opens upward (a > 0, a valley) or downward (a < 0, a hill). The roots are where that curve meets the horizontal axis. The vertex is the extreme point — the minimum of a valley or the maximum of a hill — and its x-coordinate is also the line of symmetry that mirrors the left half of the parabola onto the right.
Enter the three coefficients a, b, and c. The equation solved is a·x² + b·x + c = 0.
Example 1 — two real roots: x² - 3x + 2 = 0 (a = 1, b = -3, c = 2). The discriminant is 9 - 8 = 1 > 0, so there are two real roots: x = 1 and x = 2.
Example 2 — one repeated root: x² - 2x + 1 = 0 (a = 1, b = -2, c = 1). The discriminant is 4 - 4 = 0, giving the single root x = 1.
Example 3 — complex roots: x² + 1 = 0 (a = 1, b = 0, c = 1). The discriminant is 0 - 4 = -4 < 0, so the roots are x = ±i (plus and minus the imaginary unit).
Example 4 — vertex: for x² - 3x + 2, the vertex is at x = -(-3)/(2·1) = 1.5, and the y-value is (1.5)² - 3(1.5) + 2 = -0.25. So the vertex is (1.5, -0.25), the lowest point of the upward-opening parabola.
Example 5 — a downward parabola: -x² + 4x - 3 = 0 (a = -1, b = 4, c = -3). The discriminant is 16 - 12 = 4, so the two real roots are x = 1 and x = 3, and because a is negative the parabola opens downward, with its vertex a maximum at x = 2, y = 1. This shape is the classic inverted arch of a thrown ball at the top of its flight.
Example 6 — scaling matters: 0.5x² - x + 0.5 = 0 has discriminant 1 - 1 = 0, giving the repeated root x = 1. Fractional coefficients are handled exactly the same way as integers; do not clear fractions first unless you want to, because the calculator works with decimals directly.
Edge cases: a = 0 is rejected because the equation is then linear, not quadratic. A negative discriminant automatically switches the output to complex conjugate roots.
When you graph by hand, plot the vertex first, then use the axis of symmetry to mirror a few points. The roots, if real, are the natural x-intercepts. If the discriminant is negative, you will not find any x-intercepts on a real-number graph — the curve stays entirely on one side of the axis — but the complex roots are still mathematically meaningful and describe oscillations, rotations, and resonance in physics and engineering.
The quadratic formula comes from completing the square on ax² + bx + c = 0:
The discriminant is the part under the square root:
Its sign determines the nature of the roots:
The vertex of the parabola is at:
Manual example: solve 2x² + 4x - 6 = 0. Here a = 2, b = 4, c = -6. The discriminant Δ = 16 - 4(2)(-6) = 16 + 48 = 64. √64 = 8. So x = (-4 ± 8) / 4, giving x = 1 and x = -3. The vertex x = -4/4 = -1, y = 2(1) - 4 - 6 = -8, so vertex (-1, -8).
The derivation by completing the square makes the formula's structure transparent. Divide ax² + bx + c = 0 by a to get x² + (b/a)x + c/a = 0. Move c/a to the other side, add (b/2a)² to both sides to form a perfect square, take the square root, and isolate x. Every term in the final formula traces back to one of those algebraic steps. The discriminant is simply the radicand; its sign is the only thing that decides whether the square root is real.
In many applied problems the coefficients carry units. If x is time in seconds, then a, b, and c have units of distance over time-squared, distance over time, and distance respectively, so the roots are times. Keeping track of units prevents the common error of mixing a position in meters with a velocity in kilometers per hour. The calculator treats all inputs as pure numbers, so the user must supply consistent units.
The quadratic equation is often a student's first encounter with the idea that an equation can have more than one solution, and with solutions that are not simple integers. That generality is why quadratics model so many curved relationships in nature and engineering.
Because the quadratic formula is exact, it serves as a benchmark for numerical root-finding methods such as Newton's method. Those iterative techniques are needed for higher-degree polynomials that have no closed-form formula, but they are tested and understood using the quadratic case first.
Discriminant and Root Type for Sample Equations
| Equation | a,b,c | Discriminant | Root Type |
|---|---|---|---|
| x² - 3x + 2 | 1,-3,2 | 1 | Two real |
| x² - 2x + 1 | 1,-2,1 | 0 | One real |
| x² + 1 | 1,0,1 | -4 | Two complex |
| x² - 4 | 1,0,-4 | 16 | Two real |
| 2x² + 4x - 6 | 2,4,-6 | 64 | Two real |
| x² + x + 1 | 1,1,1 | -3 | Two complex |
The sign of the discriminant is the single number that predicts root behavior. Positive, the parabola crosses the axis twice; zero, it just touches; negative, it floats entirely above or below.
Extra practice cases that highlight different root behaviors.
Example A — rational roots: 2x² - 5x + 2 = 0 has discriminant 25 - 16 = 9, roots (5 ± 3)/4 = 2 and 0.5. Both are rational, so the quadratic factors as 2(x - 2)(x - 0.5).
Example B — irrational roots: x² - 2 = 0 has discriminant 8 and roots ±√2 ≈ ±1.414. The square root of a non-square discriminant yields irrational roots, common in geometry (the diagonal of a unit square).
Example C — pure quadratic: x² - 9 = 0 gives roots ±3, symmetric about zero because b = 0. The vertex sits at the origin, the minimum of the upward parabola.
Example D — leading coefficient negative: -3x² + 12x - 9 = 0. Divide by -3 to get x² - 4x + 3 = 0, roots 1 and 3. The negative a merely flips the parabola to open downward; the roots are unchanged by scaling the whole equation.
Example E — discriminant zero revisited: 4x² - 4x + 1 = 0 has discriminant 16 - 16 = 0, the repeated root x = 0.5, which is also (2x - 1)² = 0. A repeated root signals a perfect square trinomial.
Example F — no real roots, two complex: x² + 4 = 0 gives discriminant -16 and roots ±2i. Graphically the parabola y = x² + 4 never reaches the x-axis, floating entirely above it.
Example G — using the vertex for optimization: for -x² + 10x, the vertex is at x = 5 with value 25, the maximum. This is the same shape as a profit or area function whose optimum you find by locating the vertex.
Example H — relating roots and coefficients: for ax² + bx + c, the sum of roots is -b/a and the product is c/a. Checking x² - 3x + 2 (roots 1 and 2): sum 3 = -(-3)/1, product 2 = 2/1. These Vieta relations catch sign errors instantly.
- Look at the discriminant first. Its sign tells you immediately whether to expect two, one, or zero real roots before you compute anything.
- When Δ < 0, expect complex conjugate roots of the form p ± qi; they always come in pairs for real coefficients.
- The vertex x-coordinate -b/(2a) is also the axis of symmetry of the parabola; useful for graphing and optimization.
- For factoring practice, if the roots are integers, the quadratic factors as a(x - r₁)(x - r₂).
- Keep signs straight. A coefficient b = -3 means -b = 3 in the formula; sign errors are the most common mistake.
- Use the calculator to check hand work, especially on the vertex, which is easy to miscompute.
- Recognize the role of a. If a is positive the parabola has a minimum and opens upward; if a is negative it has a maximum and opens downward. This single sign tells you the shape before you graph anything.
- Relate the discriminant to the graph. Two real roots means two x-intercepts, one real root means the vertex sits on the axis, and no real roots means the curve misses the axis entirely.
- Use symmetry to halve your graphing effort. Once you know the vertex and one root, the other root is the same distance from the axis of symmetry on the opposite side.
- Requires a ≠ 0: The tool rejects a = 0 because that is a linear equation, solved by a different method.
- Real Coefficients Only: Complex roots are returned, but entering complex coefficients is not supported; inputs are real numbers.
- No Step-by-Step Show: The calculator gives the final roots and discriminant, not the intermediate completing-the-square derivation.
- Floating Precision: Very large or very small coefficients can lose precision in the discriminant due to floating-point limits.
- No Inequality Solving: This solves the equation = 0 only; quadratic inequalities (≥ 0) are not handled.
- No Factoring Output: It returns roots numerically, not a factored algebraic expression.
- Units Are Not Tracked: All inputs are treated as dimensionless numbers, so you must supply coefficients in consistent units yourself.
- No Parameter Sweeps: The tool solves one specific triple (a, b, c) at a time; it does not plot how the roots change as a coefficient varies.
- Repeated Roots Are Not Flagged Separately in the Roots List: A double root is shown as two equal values rather than as a single multiplicity-two root.
- What does the discriminant tell me?
- The discriminant Δ = b² - 4ac reveals the root type. Positive means two distinct real roots, zero means one repeated real root, and negative means two complex conjugate roots.
- Why do I get complex roots?
- Complex roots appear when the parabola never crosses the x-axis, so Δ < 0. The square root of a negative number is imaginary, giving roots of the form p ± qi.
- What is the quadratic formula?
- It is x = (-b ± √(b² - 4ac)) / (2a). Substitute your coefficients a, b, c and simplify to find the roots of ax² + bx + c = 0.
- What is the vertex of a parabola?
- The vertex is the highest or lowest point, at x = -b/(2a). Its y-value comes from plugging that x back into the equation. It is the axis of symmetry.
- Can a quadratic have no real solutions?
- Yes. When Δ < 0 the equation has no real roots, only complex ones. Graphically the parabola sits entirely above or below the x-axis.
- Why must a not be zero?
- If a = 0 the equation becomes linear (bx + c = 0), which is solved by a different rule. The quadratic formula divides by 2a, so a = 0 is undefined.
- How do I check my answer?
- Plug each root back into ax² + bx + c; the result should be zero (or very close, allowing for rounding). The calculator's vertex and discriminant give extra checks.
- What is a repeated root?
- When Δ = 0 the formula gives a single value x = -b/(2a) counted twice. The parabola touches the x-axis at exactly one point, the vertex.
- Are the roots always integers?
- No. Roots can be fractions, irrational numbers such as √2, or complex. Only special quadratics factor into integers.
- Where do quadratics appear in real life?
- Projectile motion, satellite-dish shapes, profit maximization, and natural vibration frequencies all reduce to quadratic equations.
Quadratic equations are not abstract exercises; they describe the curvature of the physical world. The height of a projectile launched with initial velocity v at angle θ is h(t) = vt·sin θ - (1/2)gt², a quadratic in time whose roots give the launch and landing moments and whose vertex gives the peak height. Setting that equation to zero and solving is exactly the task this calculator performs.
In business, profit often behaves like a quadratic near an optimal price. If revenue grows linearly with quantity but cost grows with the square of quantity (due to scaling, storage, or penalties), profit is a downward-opening parabola and the vertex marks maximum profit. Managers solve the derivative-free version by finding where marginal profit crosses zero, which reduces to a quadratic.
Optics and antenna design use parabolas because they focus parallel rays to a single point. The dish of a satellite receiver, the reflector of a flashlight, and the bowl of a solar cooker are all parabolic. Knowing the vertex and the focal length (related to the coefficient a) lets engineers size the dish. The equation y = ax² that defines the cross-section is solved here whenever a design constraint fixes two points on the curve.
Extended example 7 — bridge arch: an arch is modeled by y = -0.02x² + 4x, where x is horizontal distance in meters. The roots (where y = 0) are x = 0 and x = 200, so the arch spans 200 m. The vertex is at x = -4/(2·-0.02) = 100 m, with y = -0.02(10000) + 400 = 200 m, the crown height. This is the kind of symmetric result the discriminant and vertex together reveal.
Extended example 8 — break-even analysis: a product costs 5 + 0.1q per unit to make and sells for 20 - 0.05q, where q is quantity. Profit P = q(20 - 0.05q) - q(5 + 0.1q) = -0.15q² + 15q. Setting P = 0 gives -0.15q² + 15q = 0, or q(-0.15q + 15) = 0, so q = 0 and q = 100. Producing between 0 and 100 units is profitable; beyond 100 the quadratic turns negative again. The vertex at q = 50 is maximum profit.
Extended example 9 — golden ratio: the equation x² - x - 1 = 0 has roots (1 ± √5)/2. The positive root, about 1.618, is the golden ratio that appears in art, architecture, and nature. Solving it here shows how a simple quadratic encodes a famous constant. The discriminant is 1 + 4 = 5, and √5 is irrational, so the root cannot be written as a fraction — a reminder that quadratic roots are frequently irrational.
Extended example 10 — area problems: a rectangular garden of fixed perimeter 40 m has area A = w(20 - w) = 20w - w², a downward parabola. The maximum area occurs at w = 10, giving a square of area 100 m². The roots w = 0 and w = 20 are the degenerate cases where the garden collapses to a line. This optimization pattern — find the vertex of a quadratic — recurs throughout calculus and operations research.
When teaching, a good habit is to predict the discriminant before computing. A quick mental estimate of b² - 4ac often tells you whether to expect clean integer roots or something messier, which in turn tells you whether factoring by inspection will work. The calculator removes the arithmetic burden so you can focus on interpreting the result, which is the skill that transfers to every other quantitative discipline.
The two roots of a quadratic are symmetric about the axis of symmetry, and their average is always -b/(2a), the vertex's x-coordinate. This symmetry means that once you know one root and the vertex, the other root is fixed, a handy check that catches sign errors without recomputing the square root.
Quadratics are the simplest equations whose solutions can be genuinely complex. Linear equations always have a real solution (unless degenerate), but a quadratic can have none on the real line, which is the first place students meet the idea that "no real answer" is not the same as "no answer at all."
The shape of the parabola is entirely determined by the leading coefficient a and the vertex. Scaling the whole equation by a nonzero constant changes the steepness but leaves the roots untouched, which is why dividing through by a to simplify is harmless and why the discriminant's sign, not its magnitude, is what matters for root count.
Many equations that do not look quadratic can be turned into one by a substitution. An equation in x² with no x term, or a recurrence where the unknown appears squared, often reduces to ax² + bx + c = 0. Recognizing that hidden quadratic structure lets you reuse the same formula and the same calculator for problems that initially seem different.
The discriminant also predicts whether the roots are rational, irrational, or complex before you evaluate the square root. When b² - 4ac is a perfect square the roots are rational; when it is positive but not a perfect square they are irrational; when it is negative they are complex. That single number therefore summarizes the entire qualitative picture of the solution set.
Completing the square is the derivation behind the formula and a method in its own right. Rewriting ax² + bx + c as a(x - h)² + k exposes the vertex (h, k) directly and explains why the vertex formula is what it is. The calculator gives you the vertex instantly, but the completing-the-square view explains where it comes from.
Quadratic inequalities reverse the question from equations. Instead of asking where the parabola equals zero, you ask where it is above or below the axis, and the answer is an interval bounded by the roots. The roots this calculator returns are exactly the endpoints of that solution interval, so the same output serves both equality and inequality problems.
In uniform acceleration motion the position is a quadratic in time, so every kinematics problem of this type reduces to solving a quadratic. The time of flight, the maximum height, and the landing position are all encoded in the coefficients, and the discriminant even tells you whether a projectile reaches a given height at all.
- [1]Lial, Margaret L., Hornsby, John, and Schneider, David I. (2016). College Algebra and Trigonometry (6th ed.). Pearson.
- [2]Paul's Online Math Notes. (Calculus I-III).
- [3]Anton, Howard, and Rorres, Chris. (2013). Elementary Linear Algebra (11th ed.). Wiley.
- [4]Paul's Online Math Notes. (n.d.). Quadratic Equations. Retrieved from
- [5]Khan Academy. (n.d.). Quadratic equations and functions. Retrieved from
- [6]Weisstein, Eric W. (n.d.). Quadratic Equation. MathWorld — A Wolfram Web Resource.
Last updated: July 20, 2026
UnByte — Independent Software Engineering
Every calculator references authoritative sources — Editorial policy