Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Algebra

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

By MathSolver Pro Editorial Team · Published

Factoring is fastest when it works, completing the square explains where the formula comes from, and the quadratic formula always works. Here is how to choose, with every example checked.

What makes an equation quadratic

A quadratic equation can be written as ax2+bx+c=0ax^2 + bx + c = 0 with a≠0a \neq 0. The highest power of the unknown is 2, so there are at most two solutions, called roots. Before using any method, move every term to one side so that the other side is zero. This is not optional: the zero product property and the quadratic formula both depend on it.

For example, x2=3x+10x^2 = 3x + 10 becomes x2−3x−10=0x^2 - 3x - 10 = 0, so a=1a = 1, b=−3b = -3 and c=−10c = -10. Writing the three coefficients down, with their signs, before you start is the simplest way to avoid sign errors later.

Graphically, the roots are the x-intercepts of the parabola y=ax2+bx+cy = ax^2 + bx + c. A parabola can cross the x-axis twice, touch it once at its vertex, or miss it entirely, which is why a quadratic can have two, one or no real roots.

Quick cases: no x term or no constant

Two special forms need no general method at all.

  • If b=0b = 0, isolate x2x^2 and take square roots, remembering both signs: x2=49x^2 = 49 gives x=±7x = \pm 7, and 4x2−9=04x^2 - 9 = 0 gives x2=94x^2 = \frac{9}{4}, so x=±32x = \pm\frac{3}{2}.
  • If c=0c = 0, factor out xx: x2−5x=0x^2 - 5x = 0 becomes x(x−5)=0x(x - 5) = 0, so x=0x = 0 or x=5x = 5.

Never divide both sides of x2−5x=0x^2 - 5x = 0 by xx. Doing so throws away the root x=0x = 0, because you would be dividing by zero when x=0x = 0.

Method 1: factoring

If the quadratic splits into two linear factors, the zero product property finishes the job: if pq=0pq = 0 then p=0p = 0 or q=0q = 0. For a=1a = 1, look for two numbers that multiply to cc and add to bb.

x2−3x−10=(x−5)(x+2)=0⇒x=5 or x=−2x^2 - 3x - 10 = (x - 5)(x + 2) = 0 \quad\Rightarrow\quad x = 5 \text{ or } x = -2

Here −5-5 and 22 multiply to −10-10 and add to −3-3. When a≠1a \neq 1, the AC method extends the same search.

Example: 6x2+x−2=06x^2 + x - 2 = 0 by the AC method

  1. Multiply aa and cc: 6×(−2)=−126 \times (-2) = -12. Find two numbers with product −12-12 and sum b=1b = 1: they are 44 and −3-3.
  2. Split the middle term: 6x2+4x−3x−2=06x^2 + 4x - 3x - 2 = 0.
  3. Group and factor: 2x(3x+2)−1(3x+2)=(2x−1)(3x+2)=02x(3x + 2) - 1(3x + 2) = (2x - 1)(3x + 2) = 0.
  4. So x=12x = \frac{1}{2} or x=−23x = -\frac{2}{3}.

Factoring is quick but only practical when the roots are rational. A useful test: with integer coefficients, the quadratic factors over the integers exactly when the discriminant b2−4acb^2 - 4ac is a perfect square. For 6x2+x−26x^2 + x - 2 it is 1+48=49=721 + 48 = 49 = 7^2. More practice is in the guide to factoring polynomials.

Method 2: completing the square

Completing the square rewrites the left side as a perfect square plus a constant. Take x2+6x−7=0x^2 + 6x - 7 = 0. Move the constant, then add (b2)2=9\left(\frac{b}{2}\right)^2 = 9 to both sides:

x2+6x+9=16⇒(x+3)2=16⇒x+3=±4x^2 + 6x + 9 = 16 \quad\Rightarrow\quad (x + 3)^2 = 16 \quad\Rightarrow\quad x + 3 = \pm 4

So x=1x = 1 or x=−7x = -7. The same steps give the vertex form y=(x+3)2−16y = (x + 3)^2 - 16, which places the parabola's vertex at (−3,−16)(-3, -16). The full method, including the case a≠1a \neq 1, is in our guide to completing the square.

Method 3: the quadratic formula

Completing the square on the general equation ax2+bx+c=0ax^2 + bx + c = 0 produces a formula that works for every quadratic:

x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Example: 2x2+4x−3=02x^2 + 4x - 3 = 0

  1. Identify a=2a = 2, b=4b = 4, c=−3c = -3.
  2. Discriminant: b2−4ac=16−4(2)(−3)=16+24=40b^2 - 4ac = 16 - 4(2)(-3) = 16 + 24 = 40.
  3. Substitute: x=−4±404=−4±2104=−2±102x = \frac{-4 \pm \sqrt{40}}{4} = \frac{-4 \pm 2\sqrt{10}}{4} = \frac{-2 \pm \sqrt{10}}{2}.
  4. Approximately x≈0.581x \approx 0.581 or x≈−2.581x \approx -2.581. Factoring would not have found these irrational roots.

Keep the whole numerator over 2a2a. Writing −b±Δ2a-b \pm \frac{\sqrt{\Delta}}{2a} is one of the most common errors in the topic.

Reading the discriminant

The expression under the square root, Δ=b2−4ac\Delta = b^2 - 4ac, predicts the type of answer before you finish:

  • Δ>0\Delta > 0: two different real roots; the parabola crosses the x-axis twice.
  • Δ=0\Delta = 0: one repeated root; the vertex touches the x-axis. Example: x2−6x+9=(x−3)2x^2 - 6x + 9 = (x - 3)^2 has the single root x=3x = 3.
  • Δ<0\Delta < 0: no real roots, but two complex conjugate roots. Example: x2+2x+5=0x^2 + 2x + 5 = 0 has Δ=4−20=−16\Delta = 4 - 20 = -16, so x=−2±4i2=−1±2ix = \frac{-2 \pm 4i}{2} = -1 \pm 2i.

A word problem: projectile height

Quadratics model anything that rises and falls under constant acceleration. Suppose a ball's height in metres after tt seconds is h=−5t2+20t+25h = -5t^2 + 20t + 25 (using g≈10 m/s2g \approx 10\ \text{m/s}^2).

When does the ball hit the ground?

  1. Set h=0h = 0: −5t2+20t+25=0-5t^2 + 20t + 25 = 0.
  2. Divide every term by −5-5: t2−4t−5=0t^2 - 4t - 5 = 0.
  3. Factor: (t−5)(t+1)=0(t - 5)(t + 1) = 0, so t=5t = 5 or t=−1t = -1.
  4. Time cannot be negative here, so the ball lands after 5 seconds. The vertex at t=−b2a=2t = -\frac{b}{2a} = 2 gives the maximum height h=−20+40+25=45h = -20 + 40 + 25 = 45 metres.

Rejecting a root that makes no sense in context is part of the answer, not an afterthought.

Which method should you use?

  1. If b=0b = 0 or c=0c = 0, use the quick cases above.
  2. Try factoring if the coefficients are small integers and the discriminant is a perfect square.
  3. Complete the square when you also need the vertex or vertex form.
  4. Use the quadratic formula in every other case; it never fails.

Whichever method you choose, check the roots with Vieta's formulas: they should add to −ba-\frac{b}{a} and multiply to ca\frac{c}{a}. For 6x2+x−2=06x^2 + x - 2 = 0, the roots 12\frac{1}{2} and −23-\frac{2}{3} add to −16-\frac{1}{6} and multiply to −13-\frac{1}{3}, exactly −ba-\frac{b}{a} and ca\frac{c}{a}.

Common mistakes

  • Solving x2=3x+10x^2 = 3x + 10 without first moving every term to one side.
  • Taking only the positive square root, so x2=49x^2 = 49 loses x=−7x = -7.
  • Squaring a negative bb incorrectly: if b=−3b = -3 then b2=9b^2 = 9, not −9-9. Use brackets when substituting.
  • Dividing only part of the numerator by 2a2a.
  • Setting each factor equal to the wrong side: in (x−5)(x+2)=0(x - 5)(x + 2) = 0 the roots are 55 and −2-2, the opposite signs of the numbers in the brackets.

Compare your working with the quadratic equation calculator, and plot the parabola in the graphing calculator to see the roots as x-intercepts.

Choosing a method in practice

Students often ask which method is the right one. Every correct method gives the same roots, so the real question is which one is fastest and least error-prone for the equation in front of you. A quick decision routine works well. First, look for a missing term: with no constant, factor out xx; with no xx term, isolate x2x^2 and take square roots. Second, spend about fifteen seconds looking for integer factors. Third, if nothing appears, go straight to the quadratic formula rather than trying more factor pairs.

Completing the square is the better choice when the question also asks for the vertex, when the coefficient of xx is even and the leading coefficient is 1, or when you are told to use it. Graphing is excellent for estimating roots and for checking the number of real solutions, but a reading from a graph is approximate, so treat it as a check rather than a final answer unless the roots are clearly integers.

On a timed test, compute the discriminant first. If it is a perfect square, the equation factors over the integers or rationals; if it is negative, you know immediately that there are no real roots.

Checking your roots

Substitution is the most reliable check: put each root back into the original equation and confirm that the left side equals zero. For irrational roots this is tedious by hand, so use the sum and product of the roots instead. For 2x2+4x−3=02x^2 + 4x - 3 = 0, the roots −2±102\frac{-2 \pm \sqrt{10}}{2} add to −2-2, which equals −ba=−42-\frac{b}{a} = -\frac{4}{2}, and multiply to 4−104=−32\frac{4 - 10}{4} = -\frac{3}{2}, which equals ca\frac{c}{a}. Both match, so the roots are right.

Also check that the answer makes sense in context. In the projectile example, one root of the equation was negative, and a negative time before launch has no physical meaning, so only the positive root answers the question. Word problems about lengths, prices and counts often discard one root for the same reason, and it is worth writing a sentence saying why.

You can compare every step with the quadratic calculator, which shows the discriminant, the exact roots and the vertex.

Frequently asked questions

Can a quadratic equation have only one solution?

Yes. When the discriminant is zero, the two roots coincide, for example x2−6x+9=0x^2 - 6x + 9 = 0 has only x=3x = 3. The parabola touches the x-axis at its vertex.

What if the discriminant is negative?

There are no real solutions, and the parabola does not cross the x-axis. In the complex numbers there are two conjugate roots of the form p±qip \pm qi.

Is the quadratic formula always the best method?

It always works, but it is slower than factoring when the roots are small integers and slower than square-rooting when there is no xx term. Use it when the quicker methods do not apply.

How do I check quadratic roots quickly?

Substitute each root into the original equation, or use Vieta's formulas: the roots must add to −ba-\frac{b}{a} and multiply to ca\frac{c}{a}.

What should I do if the leading coefficient is negative?

Multiply every term of the equation by −1-1 first. The roots do not change, because both sides are still equal, and a positive leading coefficient makes factoring and the formula less error-prone. For example −x2+5x−6=0-x^2 + 5x - 6 = 0 becomes x2−5x+6=0x^2 - 5x + 6 = 0, so x=2x = 2 or x=3x = 3.

MathSolver Pro Editorial Team

Math content and review

Our editorial team writes every guide to explain the reasoning behind each method, not just the answer. Each worked example is checked against the site's own solver engines and automated tests before it is published, and articles are revised whenever a method or an exam format changes.