Quadratic Formula Calculator

Solve any quadratic equation ax2 + bx + c = 0 using the quadratic formula. Get real and complex roots with step-by-step solutions and discriminant analysis.

Equation
Root 1 (x1)
Root 2 (x2)
Discriminant (D)
Root Type

Quick Examples

Quadratic Formula Calculator

A quadratic formula calculator solves any second-degree polynomial equation of the form ax2 + bx + c = 0 by applying the universal quadratic formula. Simply enter the three coefficients, and the calculator computes both roots, the discriminant, and provides complete step-by-step solutions.

Students solving homework problems, engineers analyzing projectile motion, physicists modeling free fall, economists finding equilibrium prices, and designers calculating parabolic trajectories all rely on quadratic formula solutions. The quadratic formula is one of mathematics' most powerful and widely-used tools, applicable whenever a relationship involves squared terms.

Quadratic Equation Formula

The quadratic formula provides the universal method for solving any quadratic equation:

x = (-b +/- sqrt(b2 - 4ac)) / 2a

This formula yields two solutions (called roots) for x, represented as x1 and x2. The +/- symbol indicates there are two answers: one using addition, one using subtraction.

The Complete Formula Breakdown

ComponentFormulaMeaning
Quadratic Equationax2 + bx + c = 0Standard form with a ≠ 0
Quadratic Formulax = (-b +/- sqrt(D)) / 2aSolves for x
DiscriminantD = b2 - 4acDetermines root nature
Root 1x1 = (-b + sqrt(D)) / 2aSolution with plus
Root 2x2 = (-b - sqrt(D)) / 2aSolution with minus

The Discriminant: Key to Understanding Roots

The discriminant D = b2 - 4ac appears under the square root sign and determines the nature and number of roots:

DiscriminantRoot TypeGraph BehaviorExample
D > 0 (positive)Two distinct real rootsParabola crosses x-axis twicex2 - 5x + 6 = 0 has D = 1, roots x = 2, 3
D = 0 (zero)One repeated real rootParabola touches x-axis at vertexx2 - 4x + 4 = 0 has D = 0, root x = 2
D < 0 (negative)Two complex conjugate rootsParabola does not intersect x-axisx2 + 1 = 0 has D = -4, roots x = +/-i

Sum and Product of Roots

The roots have elegant relationships with the coefficients:

  • Sum of roots: x1 + x2 = -b/a
  • Product of roots: x1 x x2 = c/a

These Vieta's formulas provide quick verification of solutions and are essential in advanced algebra.

Quadratic Equation Graph

The graph of a quadratic function y = ax2 + bx + c is a parabola — a symmetric U-shaped curve. Understanding this graph reveals the relationship between algebra and geometry.

Key Graph Features

FeatureFormulaDescription
ShapeParabolaSymmetric U-shaped curve
DirectionUp if a > 0, Down if a < 0Determined by leading coefficient
Vertex(-b/2a, f(-b/2a))Minimum (a>0) or maximum (a<0) point
Axis of Symmetryx = -b/(2a)Vertical line through vertex
Y-intercept(0, c)Where parabola crosses y-axis
X-interceptsRoots from quadratic formulaWhere parabola crosses x-axis (if D >= 0)
WidthSteeper if |a| is larger|a| controls how narrow/wide

How to Graph a Quadratic Equation

  1. Find the vertex: Calculate x = -b/(2a), then find y = f(x). Plot this point.
  2. Draw the axis of symmetry: Draw dashed vertical line x = -b/(2a).
  3. Find x-intercepts (zeros): Use the quadratic formula. Plot if roots are real.
  4. Find the y-intercept: Plot point (0, c).
  5. Determine direction: If a > 0, parabola opens upward; if a < 0, opens downward.
  6. Plot additional points: Calculate y-values for convenient x-values on both sides of vertex.
  7. Draw smooth curve: Connect points with a smooth parabola, symmetric about the axis.

Graph Interpretation Based on Discriminant

  • D > 0: Parabola crosses the x-axis at two points (the real roots).
  • D = 0: Parabola touches the x-axis at exactly one point (the vertex lies on the x-axis).
  • D < 0: Parabola floats entirely above x-axis (a > 0) or below x-axis (a < 0) — no x-intercepts.

Example: Graph y = x2 - 4x + 3

  • Coefficients: a = 1, b = -4, c = 3
  • Vertex: x = -(-4)/(2x1) = 2, y = 22 - 4(2) + 3 = -1, so vertex is (2, -1)
  • Axis of symmetry: x = 2
  • Discriminant: D = (-4)2 - 4(1)(3) = 4, so two real roots
  • Roots: x = (4 +/- sqrt(4))/2 = (4 +/- 2)/2, so x = 3 and x = 1
  • X-intercepts: (1, 0) and (3, 0)
  • Y-intercept: (0, 3)
  • Direction: a = 1 > 0, opens upward with minimum at vertex

Derivation of the Quadratic Formula

The quadratic formula isn't magic — it's derived by completing the square on the general quadratic equation. Here is the complete derivation:

Step-by-Step Derivation

Start: ax2 + bx + c = 0 (where a ≠ 0)

Step 1: Divide both sides by a:

x2 + (b/a)x + c/a = 0

Step 2: Move constant term to the right side:

x2 + (b/a)x = -c/a

Step 3: Add (b/2a)2 to both sides to complete the square:

x2 + (b/a)x + (b/2a)2 = -c/a + (b/2a)2

Step 4: Factor the left side as a perfect square:

(x + b/2a)2 = -c/a + b2/(4a2)

Step 5: Combine the right side over a common denominator:

(x + b/2a)2 = (-4ac + b2)/(4a2)

Step 6: Recognize the discriminant D = b2 - 4ac:

(x + b/2a)2 = D/(4a2)

Step 7: Take the square root of both sides:

x + b/2a = +/-sqrt(D)/(2a)

Step 8: Solve for x:

x = -b/2a +/- sqrt(D)/(2a) = (-b +/- sqrt(D)) / 2a

Final Result: The quadratic formula:

x = (-b +/- sqrt(b2 - 4ac)) / 2a

Why Completing the Square Works

Adding (b/2a)2 transforms x2 + (b/a)x into a perfect square trinomial (x + b/2a)2. This is the algebraic equivalent of finding the geometric "missing piece" that makes the expression a complete square.

How to Solve a Quadratic Equation

Solving a quadratic equation follows a systematic five-step process. Here's the complete method:

Step 1: Write in Standard Form

Rearrange the equation so all terms are on one side, equal to zero:

ax2 + bx + c = 0

Example: If given 2x2 = 5x - 3, rewrite as 2x2 - 5x + 3 = 0

Step 2: Form an Equation and Identify

Confirm that the equation is quadratic (degree 2) and that a ≠ 0:

  • If a = 0, it's a linear equation (bx + c = 0), not quadratic
  • If the highest power is 2 and a ≠ 0, proceed with quadratic formula

Step 3: Find the Coefficients

Identify the three coefficients a, b, and c from the standard form:

Equationabc
x2 - 5x + 6 = 01-56
2x2 + 3x - 5 = 023-5
x2 - 9 = 010-9
4x2 - 8x = 04-80
x2 + 4x = 0140

Be careful with signs! In x2 - 5x + 6, b = -5 (negative), not 5.

Step 4: Put the Values into the Formula

Substitute a, b, and c into the quadratic formula:

x = (-b +/- sqrt(b2 - 4ac)) / 2a

Step 5: Solve and Find Both Roots

  1. Calculate the discriminant: D = b2 - 4ac
  2. Find the square root of the discriminant
  3. Apply the formula with plus sign for x1
  4. Apply the formula with minus sign for x2
  5. Verify your answers by plugging back into the original equation

Examples: Solving Quadratic Equations

Example 1: Two Distinct Real Roots

Solve: x2 - 5x + 6 = 0

  • Step 1: Already in standard form
  • Step 2: Coefficients: a = 1, b = -5, c = 6
  • Step 3: Discriminant: D = (-5)2 - 4(1)(6) = 25 - 24 = 1
  • Step 4: D > 0, so two distinct real roots
  • Step 5: x = (5 +/- sqrt(1))/2 = (5 +/- 1)/2
  • Root 1: x = (5 + 1)/2 = 6/2 = 3
  • Root 2: x = (5 - 1)/2 = 4/2 = 2
  • Solutions: x = 2 and x = 3
  • Verification: 22 - 5(2) + 6 = 4 - 10 + 6 = 0 ✓

Example 2: One Repeated Root (Double Root)

Solve: x2 - 4x + 4 = 0

  • Coefficients: a = 1, b = -4, c = 4
  • Discriminant: D = (-4)2 - 4(1)(4) = 16 - 16 = 0
  • D = 0, so one repeated root
  • x = (4 +/- sqrt(0))/2 = 4/2 = 2
  • Solution: x = 2 (double root)
  • The parabola touches the x-axis at exactly one point (2, 0)

Example 3: Complex Roots

Solve: x2 + 2x + 5 = 0

  • Coefficients: a = 1, b = 2, c = 5
  • Discriminant: D = (2)2 - 4(1)(5) = 4 - 20 = -16
  • D < 0, so complex roots
  • x = (-2 +/- sqrt(-16))/2 = (-2 +/- 4i)/2
  • Root 1: x = -1 + 2i
  • Root 2: x = -1 - 2i
  • Solutions: x = -1 + 2i and x = -1 - 2i
  • Note: Complex roots always come in conjugate pairs

Example 4: Non-Monic Quadratic (a ≠ 1)

Solve: 2x2 - 7x + 3 = 0

  • Coefficients: a = 2, b = -7, c = 3
  • Discriminant: D = (-7)2 - 4(2)(3) = 49 - 24 = 25
  • D = 25 = 52, a perfect square, so nice roots
  • x = (7 +/- sqrt(25))/(2*2) = (7 +/- 5)/4
  • Root 1: x = (7 + 5)/4 = 12/4 = 3
  • Root 2: x = (7 - 5)/4 = 2/4 = 1/2
  • Solutions: x = 3 and x = 1/2

Example 5: Missing Linear Term (b = 0)

Solve: x2 - 16 = 0

  • Coefficients: a = 1, b = 0, c = -16
  • Discriminant: D = 02 - 4(1)(-16) = 64
  • x = (0 +/- sqrt(64))/2 = +/-8/2
  • Solutions: x = 4 and x = -4
  • Alternative method: Take square root of both sides: x2 = 16, x = +/-4

Example 6: Missing Constant Term (c = 0)

Solve: x2 + 4x = 0

  • Coefficients: a = 1, b = 4, c = 0
  • Discriminant: D = 42 - 4(1)(0) = 16
  • x = (-4 +/- sqrt(16))/2 = (-4 +/- 4)/2
  • Root 1: x = (-4 + 4)/2 = 0
  • Root 2: x = (-4 - 4)/2 = -8/2 = -4
  • Solutions: x = 0 and x = -4
  • Alternative method: Factor out x: x(x + 4) = 0

Methods for Solving Quadratic Equations

While the quadratic formula works universally, other methods apply in specific cases:

MethodWhen to UseExampleSolution
Quadratic FormulaAlways works; any quadraticx2 - x - 1 = 0x = (1 +/- sqrt(5))/2
FactoringD is a perfect square; integer rootsx2 - 5x + 6 = 0(x-2)(x-3)=0, x=2,3
Completing SquareFinding vertex form; derivationx2 - 6x + 5 = 0(x-3)2 = 4, x = 3 +/- 2
Square Root Methodb = 0 (no linear term)x2 - 9 = 0x2 = 9, x = +/-3
GraphingApproximate answers; visualAny quadraticRead x-intercepts

When to Use Which Method

  • Quadratic formula: Default choice — always works, handles all cases including complex roots.
  • Factoring: Fastest when discriminant is a perfect square. Check if two numbers multiply to ac and add to b.
  • Completing the square: Useful for finding vertex form y = a(x - h)2 + k.
  • Square root method: Perfect for equations like x2 = k or (x + h)2 = k.

Real-Life Applications of Quadratic Equations

Projectile Motion

Objects under constant acceleration follow parabolic paths. Height h after time t: h = -4.9t2 + v0t + h0. Solve for when a ball reaches certain height or hits the ground.

Business and Economics

Revenue R = px where p depends on x: R = ax2 + bx. Finding profit-maximizing production levels involves finding the vertex. Equilibrium prices use intersection of supply and demand curves.

Engineering and Architecture

Suspension bridge cables form parabolas. Satellite dishes use parabolic reflectors. Arches in architecture follow quadratic curves. Finding optimal shapes involves quadratic equations.

Physics and Optics

Free fall distance d = 4.9t2. Lens equations, mirror equations, and optical paths involve quadratic relationships. Energy calculations in kinematics use squared velocity terms.

Agriculture and Gardening

Maximizing rectangular garden area with fixed perimeter. Finding optimal dimensions for enclosures. The area A = x(L - 2x) for given length L is quadratic.

Computer Graphics

Parabolic curves for animations, bezier curves, and physics simulations. Collision detection in games uses quadratic equations for parabolic trajectories.

Quadratic Equations in Programming

JavaScript Implementation

function solveQuadratic(a, b, c) {
    if (a === 0) return { error: "Not a quadratic (a = 0)" };

    const discriminant = b * b - 4 * a * c;

    if (discriminant >= 0) {
        // Real roots
        const sqrtD = Math.sqrt(discriminant);
        return {
            root1: (-b + sqrtD) / (2 * a),
            root2: (-b - sqrtD) / (2 * a),
            discriminant: discriminant,
            type: discriminant === 0 ? "double" : "real"
        };
    } else {
        // Complex roots
        const realPart = -b / (2 * a);
        const imagPart = Math.sqrt(-discriminant) / (2 * a);
        return {
            root1: { real: realPart, imag: imagPart },
            root2: { real: realPart, imag: -imagPart },
            discriminant: discriminant,
            type: "complex"
        };
    }
}

Python Implementation

import math

def solve_quadratic(a, b, c):
    if a == 0:
        return None  # Linear equation

    discriminant = b**2 - 4*a*c

    if discriminant > 0:
        x1 = (-b + math.sqrt(discriminant)) / (2*a)
        x2 = (-b - math.sqrt(discriminant)) / (2*a)
        return x1, x2
    elif discriminant == 0:
        x = -b / (2*a)
        return x, x
    else:  # Complex roots
        import cmath
        x1 = (-b + cmath.sqrt(discriminant)) / (2*a)
        x2 = (-b - cmath.sqrt(discriminant)) / (2*a)
        return x1, x2

Key Concepts and Glossary

  • Quadratic equation: Second-degree polynomial equation ax2 + bx + c = 0 with a ≠ 0.
  • Quadratic formula: x = (-b +/- sqrt(b2 - 4ac)) / 2a, universal solver for all quadratics.
  • Discriminant: D = b2 - 4ac, determines nature and number of roots.
  • Root (zero): Value of x that makes the quadratic equal zero; x-intercept of graph.
  • Parabola: U-shaped graph of a quadratic function; symmetric about the axis.
  • Vertex: Maximum or minimum point of the parabola at (-b/2a, f(-b/2a)).
  • Axis of symmetry: Vertical line x = -b/(2a) through the vertex.
  • Completing the square: Method of rewriting ax2 + bx + c as a(x + h)2 + k.
  • Double root: When D = 0, both roots are the same value.
  • Complex conjugates: When D < 0, roots are of form p +/- qi.
  • Vieta's formulas: Sum of roots = -b/a, product = c/a.

Tips and Best Practices

  • Always verify: Plug solutions back into the original equation to confirm.
  • Watch sign errors: The most common mistake is getting b's sign wrong.
  • Check for a = 0: If a = 0, it's linear, not quadratic — formula fails.
  • Simplify first: If coefficients share a factor, divide through first.
  • Standard form first: Always write as ax2 + bx + c = 0 before solving.
  • Use factoring when easy: If D is a perfect square, factoring may be faster.
  • Complex roots come in pairs: If one root is a + bi, the other is a - bi.

Common Mistakes to Avoid

  • Sign error with b: In x2 - 5x + 6, b = -5, not 5. This flips the sign in -b.
  • Forgetting 2a in denominator: The formula divides by 2a, not just a.
  • Negative under square root: D < 0 gives complex roots, not "no solution."
  • Only finding one root: Quadratics have two roots; find both.
  • Not writing in standard form: Must equal zero before identifying coefficients.
  • Division error: Remember order of operations — divide after the square root.
  • Confusing a, b, c: a is x2 coefficient, b is x coefficient, c is constant.

Frequently Asked Questions

What is the quadratic formula?
The quadratic formula is x = (-b +/- sqrt(b2 - 4ac)) / 2a. It provides the solutions to any quadratic equation ax2 + bx + c = 0. The term b2 - 4ac is called the discriminant and determines whether roots are real or complex: positive means two real roots, zero means one repeated root, negative means two complex conjugate roots.
How do you solve a quadratic equation?
Write the equation in standard form ax2 + bx + c = 0, identify coefficients a, b, and c, substitute them into the quadratic formula, calculate the discriminant b2 - 4ac, then compute both roots. The formula works universally for any quadratic equation including those with complex roots.
What does the discriminant tell us?
The discriminant D = b2 - 4ac reveals the nature of roots: D > 0 means two distinct real roots (parabola crosses x-axis twice), D = 0 means one repeated real root at the vertex (parabola touches x-axis), D < 0 means two complex conjugate roots (parabola doesn't reach x-axis).
What is the standard form of a quadratic equation?
The standard form is ax2 + bx + c = 0 where a, b, and c are real numbers and a cannot equal zero (otherwise it's linear). The coefficient a determines if the parabola opens upward (a > 0) or downward (a < 0). Writing in standard form makes identifying coefficients straightforward.
How do you graph a quadratic equation?
A quadratic equation y = ax2 + bx + c graphs as a parabola. Find the vertex at x = -b/(2a) and calculate its y-coordinate, plot the vertex, find x-intercepts using the quadratic formula (if they exist), find the y-intercept at (0, c), then draw a smooth symmetric parabola through these points opening upward if a > 0 or downward if a < 0.
What is a zero of a quadratic function?
A zero (or root) is a value of x that makes the quadratic function equal zero. For f(x) = ax2 + bx + c, zeros are the x-values where f(x) = 0. These are precisely the x-intercepts of the parabola and are found using the quadratic formula. A quadratic always has exactly two zeros (counting multiplicity).
Can a quadratic equation have no real solutions?
Yes, when the discriminant is negative (b2 - 4ac < 0), the quadratic has no real solutions but two complex conjugate solutions. The parabola does not cross or touch the x-axis. For example, x2 + 1 = 0 has discriminant -4 and roots x = i and x = -i — no real solutions.
What is completing the square?
Completing the square is rewriting ax2 + bx + c as a(x + h)2 + k, which reveals the vertex at (-h, k). This method transforms the quadratic by adding (b/2a)2 to both sides. It's used to derive the quadratic formula and to find vertex form for graphing.
How many solutions does a quadratic equation have?
A quadratic equation always has exactly two solutions (counting multiplicity). These might be two distinct real numbers, one repeated real number (double root when D = 0), or two complex conjugate numbers. The Fundamental Theorem of Algebra guarantees a degree-n polynomial has n roots, so quadratics have 2.
What happens when a equals zero?
If a = 0, the equation becomes bx + c = 0, which is linear, not quadratic. The quadratic formula cannot be applied because dividing by 2a = 0 is undefined. A linear equation has exactly one solution: x = -c/b (if b ≠ 0), unlike quadratics which have two solutions.
How is the quadratic formula derived?
The formula is derived by completing the square on ax2 + bx + c = 0: divide by a, move c to the right side, add (b/2a)2 to both sides to create a perfect square trinomial, factor the left side as (x + b/2a)2, take the square root of both sides, and solve for x. This algebraic manipulation produces the universal formula.
What is the vertex of a parabola?
The vertex is the turning point of the parabola, located at x = -b/(2a) with y-coordinate f(-b/2a). If a > 0, the vertex is the minimum point (parabola opens upward); if a < 0, it's the maximum point (parabola opens downward). The vertex form y = a(x - h)2 + k directly shows the vertex at (h, k).
How do you factor a quadratic equation?
Some quadratics factor as (x - r1)(x - r2) = 0 where r1 and r2 are roots. Find two numbers that multiply to ac and add to b. Not all quadratics factor nicely with integers — those with irrational or complex roots require the quadratic formula. Factoring works best when the discriminant is a perfect square.
What is the axis of symmetry?
The axis of symmetry is the vertical line x = -b/(2a) passing through the vertex. The parabola is perfectly mirrored across this line — every point on one side has a corresponding point at equal distance on the other side. The axis divides the parabola into two congruent halves.

Historical Context

Ancient Babylon (2000-1600 BCE): Babylonian mathematicians solved quadratic problems using geometric methods. Clay tablets show problems leading to quadratics solved by completing the square geometrically.

Ancient Greece: Euclid's Elements (300 BCE) contained geometric methods equivalent to solving quadratics. Diophantus (3rd century CE) solved quadratic equations algebraically.

Medieval Islamic mathematics: Al-Khwarizmi (9th century CE) gave systematic solutions for quadratics in his book "Al-Jabr." The word "algebra" comes from this work. He recognized six standard forms of quadratic equations and provided solution methods.

Renaissance Europe: Cardano and Tartaglia (16th century) developed methods for solving cubic equations, which built upon quadratic understanding. The modern quadratic formula in its current form became standard.

Modern era: The discriminant concept was formalized. Complex numbers were accepted as solutions. The formula now appears in every algebra textbook as the universal method for solving quadratics.

Related Calculators

These tools extend quadratic equation concepts:

  • Linear Equation Calculator: Solve first-degree equations.
  • Cubic Equation Calculator: Solve third-degree polynomials.
  • Inequality Calculator: Solve quadratic inequalities.
  • Factor Calculator: Factor polynomials into factors.
  • Square Root Calculator: Calculate square roots for discriminant.
  • Function Graphing: Visualize quadratic functions.

Conclusion

The quadratic formula stands as one of mathematics' most elegant and powerful tools, providing universal solutions to any second-degree polynomial equation. Whether roots are rational, irrational, or complex, the formula x = (-b +/- sqrt(b2 - 4ac)) / 2a delivers exact answers.

This page covered the complete quadratic equation toolkit: the formula itself, its derivation through completing the square, graph interpretation via parabola analysis, a systematic five-step solving process, and multiple worked examples spanning all discriminant cases. Understanding the discriminant — positive, zero, or negative — reveals whether solutions are two real numbers, one repeated number, or a pair of complex conjugates.

Use the quadratic formula calculator above for instant solutions with step-by-step breakdowns. Whether checking homework, analyzing projectile motion, finding business equilibrium, or solving any application involving squared terms, this tool provides complete mathematical analysis for learning and verification.