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.
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:
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
| Component | Formula | Meaning |
|---|---|---|
| Quadratic Equation | ax2 + bx + c = 0 | Standard form with a ≠ 0 |
| Quadratic Formula | x = (-b +/- sqrt(D)) / 2a | Solves for x |
| Discriminant | D = b2 - 4ac | Determines root nature |
| Root 1 | x1 = (-b + sqrt(D)) / 2a | Solution with plus |
| Root 2 | x2 = (-b - sqrt(D)) / 2a | Solution 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:
| Discriminant | Root Type | Graph Behavior | Example |
|---|---|---|---|
| D > 0 (positive) | Two distinct real roots | Parabola crosses x-axis twice | x2 - 5x + 6 = 0 has D = 1, roots x = 2, 3 |
| D = 0 (zero) | One repeated real root | Parabola touches x-axis at vertex | x2 - 4x + 4 = 0 has D = 0, root x = 2 |
| D < 0 (negative) | Two complex conjugate roots | Parabola does not intersect x-axis | x2 + 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
| Feature | Formula | Description |
|---|---|---|
| Shape | Parabola | Symmetric U-shaped curve |
| Direction | Up if a > 0, Down if a < 0 | Determined by leading coefficient |
| Vertex | (-b/2a, f(-b/2a)) | Minimum (a>0) or maximum (a<0) point |
| Axis of Symmetry | x = -b/(2a) | Vertical line through vertex |
| Y-intercept | (0, c) | Where parabola crosses y-axis |
| X-intercepts | Roots from quadratic formula | Where parabola crosses x-axis (if D >= 0) |
| Width | Steeper if |a| is larger | |a| controls how narrow/wide |
How to Graph a Quadratic Equation
- Find the vertex: Calculate x = -b/(2a), then find y = f(x). Plot this point.
- Draw the axis of symmetry: Draw dashed vertical line x = -b/(2a).
- Find x-intercepts (zeros): Use the quadratic formula. Plot if roots are real.
- Find the y-intercept: Plot point (0, c).
- Determine direction: If a > 0, parabola opens upward; if a < 0, opens downward.
- Plot additional points: Calculate y-values for convenient x-values on both sides of vertex.
- 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:
Step 2: Move constant term to the right side:
Step 3: Add (b/2a)2 to both sides to complete the square:
Step 4: Factor the left side as a perfect square:
Step 5: Combine the right side over a common denominator:
Step 6: Recognize the discriminant D = b2 - 4ac:
Step 7: Take the square root of both sides:
Step 8: Solve for x:
Final Result: The quadratic formula:
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:
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:
| Equation | a | b | c |
|---|---|---|---|
| x2 - 5x + 6 = 0 | 1 | -5 | 6 |
| 2x2 + 3x - 5 = 0 | 2 | 3 | -5 |
| x2 - 9 = 0 | 1 | 0 | -9 |
| 4x2 - 8x = 0 | 4 | -8 | 0 |
| x2 + 4x = 0 | 1 | 4 | 0 |
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:
Step 5: Solve and Find Both Roots
- Calculate the discriminant: D = b2 - 4ac
- Find the square root of the discriminant
- Apply the formula with plus sign for x1
- Apply the formula with minus sign for x2
- 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:
| Method | When to Use | Example | Solution |
|---|---|---|---|
| Quadratic Formula | Always works; any quadratic | x2 - x - 1 = 0 | x = (1 +/- sqrt(5))/2 |
| Factoring | D is a perfect square; integer roots | x2 - 5x + 6 = 0 | (x-2)(x-3)=0, x=2,3 |
| Completing Square | Finding vertex form; derivation | x2 - 6x + 5 = 0 | (x-3)2 = 4, x = 3 +/- 2 |
| Square Root Method | b = 0 (no linear term) | x2 - 9 = 0 | x2 = 9, x = +/-3 |
| Graphing | Approximate answers; visual | Any quadratic | Read 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
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.