Calculator

How to Solve Quadratic Equations: Formula, Discriminant, Factoring & Completing the Square

A quadratic equation has the form ax^2+bx+c=0 and is one of the milestones of school math. This article explains, in beginner-friendly terms, three ways to solve them (factoring, completing the square, and the quadratic formula), how the discriminant D=b^2-4ac tells you the number of real roots, and how it all connects to the parabola graph.

Published: 2026-10-16

Have you ever seen an equation that contains a squared variable, like "x^2 - 5x + 6 = 0"? That is a quadratic equation. Unlike a linear equation, it can have two solutions, and there are several ways to solve it, so many people find it intimidating at first. But once you learn a few patterns and procedures, you can solve any quadratic equation with the same flow. This article walks you through what a quadratic equation is, three ways to solve it, the discriminant, and the connection to the graph.

What Is a Quadratic Equation: the General Form ax^2+bx+c=0

A quadratic equation is an equation whose highest degree is 2. Using the variable x, it is generally written in the following general form.

ax^2 + bx + c = 0 (where a ≠ 0)

Here a, b, and c are constants: a is the quadratic coefficient, b is the linear coefficient, and c is the constant term. If a were 0, the x^2 term would vanish and it would become a mere linear equation, so a quadratic equation always requires a ≠ 0.

A "solution (root)" of a quadratic equation is a value of x that makes the equation true. A linear equation usually has one solution, but a key feature of a quadratic equation is that it can have up to two solutions. There are three main methods: factoring, completing the square, and the quadratic formula, and choosing among them by the shape of the equation is efficient. To get a feel by doing, try entering coefficients into the Quadratic Equation Solver and seeing how the solutions come out.

Solving by Factoring

The fastest method, when it works, is factoring. If you can rewrite the left side as "(x - p)(x - q) = 0," then from the property that a product is 0 only when one of the factors is 0 (if AB = 0 then A = 0 or B = 0), you immediately get x = p or x = q.

Let us solve "x^2 - 5x + 6 = 0" as an example. Looking for two numbers that multiply to 6 and add to -5, we find -2 and -3. So we can rewrite it as follows.

x^2 - 5x + 6 = (x - 2)(x - 3) = 0

Therefore x - 2 = 0 or x - 3 = 0, giving x = 2 and x = 3. When the coefficients are integers and factor conveniently, factoring is the shortest route. However, if the solutions are not integers or simple fractions, factoring is hard, and you then rely on completing the square or the quadratic formula described below.

Solving by Completing the Square

Even when an equation cannot be factored, completing the square always works. It rewrites the left side into the squared form "(x + m)^2 = n" and then takes the square root of both sides. The quadratic formula itself is derived from this technique.

Take "x^2 + 6x + 1 = 0" as an example. First, move the constant to the right.

x^2 + 6x = -1

Next, take half of the coefficient of x (which is 6), giving 3, square it to get 9, and add it to both sides to make the left side a perfect square.

x^2 + 6x + 9 = -1 + 9 → (x + 3)^2 = 8

Then take the square root of both sides, remembering to add the ± sign.

x + 3 = ±√8 = ±2√2 → x = -3 ± 2√2

Completing the square involves a few more steps, but it is a universal method that works for any quadratic equation. Since you need to compute square roots along the way, using the Scientific Calculator alongside it makes checking square roots and decimal values smooth.

The Quadratic Formula

Because completing the square every time is tedious, the quadratic formula generalizes it. For the general form ax^2 + bx + c = 0, the solutions are found in one shot with the following expression.

x = ( -b ± √(b^2 - 4ac) ) / 2a

Using it is simple: just plug in the values of a, b, and c. For "2x^2 + 3x - 1 = 0," substitute a = 2, b = 3, c = -1.

x = ( -3 ± √(3^2 - 4·2·(-1)) ) / (2·2) = ( -3 ± √(9 + 8) ) / 4 = ( -3 ± √17 ) / 4

The strength of the formula is that it solves even non-factorable equations mechanically. As long as you watch out for sign mistakes (especially when b or c is negative), it handles any problem. To check your work, enter the same coefficients into the Quadratic Equation Solver and confirm that your hand calculation matches.

The Discriminant D=b^2-4ac and the Number of Real Roots

The part under the square root in the formula, namely D = b^2 - 4ac, is called the discriminant. Without actually solving, just looking at the sign of D tells you how many real roots there are.

Value of discriminant DNumber of real rootsMeaning
D > 02 (two distinct real roots)Under the root is positive, so ± applies
D = 01 (a repeated root)Under the root is 0, so ± disappears
D < 00 (no real roots)Under the root becomes negative

If D > 0, then √(b^2 - 4ac) is a positive real number, so you get two solutions from + and -. When D = 0, the value under the root is 0, so it is ±0, meaning the solutions merge into one. This is called a repeated root. If D < 0, you would need the square root of a negative number, which has no solution within the real numbers (in higher grades it is handled as an "imaginary root").

For example, "x^2 - 4x + 4 = 0" has D = (-4)^2 - 4·1·4 = 16 - 16 = 0, so it has a repeated root, and indeed (x - 2)^2 = 0 gives only x = 2. The discriminant is a handy tool for seeing the nature of a problem before solving it.

The Link to the Graph (Parabola)

A quadratic equation is deeply tied to the graph of the quadratic function y = ax^2 + bx + c (a parabola). The solutions of the quadratic equation ax^2 + bx + c = 0 are nothing other than the x-coordinates of the points where the parabola crosses the x-axis (y = 0).

Here the discriminant appears again. The positional relationship between the parabola and the x-axis is decided directly by the sign of D.

  • D > 0: the parabola crosses the x-axis at two points, so there are 2 real roots.
  • D = 0: the parabola touches the x-axis (at one point), so there is 1 repeated root.
  • D < 0: the parabola does not meet the x-axis, so there are 0 real roots.

Thus "the number of solutions of the equation" and "the number of intersections of the graph with the x-axis" match exactly. Algebra (calculating expressions) and geometry (the shape of the graph) describe the same fact from different angles. If a is positive the parabola opens upward (valley shape), and if negative it opens downward (mountain shape); the position of the vertex can be read from the m in (x + m)^2 = n obtained by completing the square. Once you can move back and forth between the equation and the graph, your understanding of quadratic equations deepens considerably.

Quadratic equations are nothing to fear once you have the three tools of factoring, completing the square, and the quadratic formula, the way to gauge problems with the discriminant, and the connection to the graph. Start by checking your answers with the Quadratic Equation Solver, and confirm fine calculations like square roots with the Scientific Calculator; your hand-calculation accuracy will naturally improve.

Please note that this article is intended to provide general information. Content and notation may differ by textbook or curriculum, so make your decision after checking the latest official information and learning materials.

FAQ

What is a quadratic equation?

A quadratic equation is an equation whose highest degree is 2, generally written as ax^2 + bx + c = 0 (a ≠ 0). Here a is the quadratic coefficient, b the linear coefficient, and c the constant term. Unlike a linear equation, it can have up to two solutions, which you find by factoring, completing the square, or the quadratic formula.

Which method should I use to solve a quadratic equation?

It is best to first try factoring. If the coefficients are integers and factor cleanly, you can solve it in the shortest way. If factoring is hard, the quadratic formula x = (-b ± √(b^2 - 4ac)) / 2a solves any equation mechanically. Completing the square is the basis of the formula and is useful when you want the vertex.

What is the discriminant D=b^2-4ac used for?

The discriminant lets you count the number of real roots without actually solving. If D > 0 there are two distinct real roots, if D = 0 a repeated root (1), and if D < 0 there are no real roots (imaginary roots). This corresponds directly to how many points the parabola crosses the x-axis.

What is a repeated root?

A repeated root is when the two solutions of a quadratic equation merge into one. It occurs when the discriminant D = b^2 - 4ac equals 0, so the ± in the formula disappears and there is a single solution. On the graph it corresponds to the parabola touching the x-axis at exactly one point. For example, x^2 - 4x + 4 = 0 has a repeated root x = 2.

Are the equations or numbers I enter into the solver sent to a server?

WAZA TOOLS' Quadratic Equation Solver and Scientific Calculator run entirely in your browser, so the coefficients you enter and the results are never sent to or stored on a server. They work on smartphones too, and you can calculate as many times as you like, for free.