How to solve quadratic equations: 5 methods, step by step

How to solve quadratic equations: 5 methods, step by step

To solve a quadratic equation, put it in standard form, compute the discriminant D = b² − 4ac, and let those two things pick the method: a perfect-square D means it factors, a perfect-square side with no x term means you can take square roots, and everything else means completing the square or the quadratic formula. In this guide, how to solve quadratic equations is not five textbook examples — it is one equation, x² − 3x + 1 = 0, worked to the last step by each algebraic method and checked by substitution.

What a quadratic equation is, and the three markers that pick the method

A quadratic equation is any equation you can rearrange into ax² + bx + c = 0 with a ≠ 0. Rearranging is a step in its own right, and it is where most wrong answers start, so it gets its own section below.

The main equation in this post is x² = 3x − 1, whose standard form is x² − 3x + 1 = 0. That gives a = 1, b = −3, c = 1, and D = b² − 4ac = 9 − 4 = 5.

Three markers decide the method, in this order:

  1. Is there an x term? If not, one side is already a perfect square and the square-root property finishes it in two lines.

  2. Is D a perfect square (0, 1, 4, 9, 16, 25, …)? If it is, the equation factors over the integers.

  3. What sign does D have? Positive: two real roots. Zero: one repeated root. Negative: no real roots at all.

For x² − 3x + 1 = 0: there is an x term, D = 5 is not a perfect square, and D is positive. That means two real roots and no integer factoring — the two facts every later section leans on.

Which of the five methods your equation wants — and how to tell in three seconds

Read the shape of the equation first, then the discriminant:

What you seeExampleMethod
One side a perfect square, no x term elsewhere(x − 2)² = 4square-root property
D is a perfect squareD = 49 = 7²factoring
D > 0, not a perfect squareD = 5completing the square, or the quadratic formula
D = 0D = 16 − 16 = 0one repeated root, from a perfect-square factor
D < 0D = 1 − 24 = −23no real roots; the parabola never crosses the axis
You want a picture, or the number of rootsy = x² − 3x + 1graphing

Walking x² − 3x + 1 = 0 through it takes three seconds: there is an x term (so not the square-root property), D = 5 is not a perfect square (so not factoring), and D > 0 (so two real roots). Completing the square or the formula is the route; the graph then confirms two crossings, near 2.618 and 0.382, without giving them exactly.

Those first two algebraic routes are not rivals: the quadratic formula is completing the square done once with letters instead of numbers, which is why both return (3 ± √5)/2.

Get the equation into standard form first

For x² = 3x − 1, subtract 3x from both sides and add 1: x² − 3x + 1 = 0. Both terms have to cross. Stopping at x² − 3x = −1 is not wrong, but it is not standard form, and reading a, b and c off it is how c becomes −1 instead of +1.

For fractions, multiply every term by the common denominator. Take (1/2)x² + (2/3)x = 1: multiply by 6 and you get 3x² + 4x = 6, so 3x² + 4x − 6 = 0 with a = 3, b = 4, c = −6.

For a 1/x term, multiply both sides by x and note what that costs you. Take x + 1/x = 3, with x ≠ 0: multiplying gives x² + 1 = 3x, so x² − 3x + 1 = 0 — the main equation again. Multiplying by a variable can create a root the original equation does not allow. Here the candidate is x = 0, which is refused because 1/0 is undefined. That is why, whenever you have multiplied by a variable, you check each root in the original equation and not in the tidied-up one.

How to solve quadratic equations by factoring — worked on 2x² + 5x − 3 = 0

This section uses its own equation for one reason: factoring over the integers needs a perfect-square discriminant, and the main equation's D = 5 is not one. Nothing with integer coefficients factors x² − 3x + 1. So the example here is one that does factor, with a ≠ 1 so the ac-method gets shown instead of hidden behind a = 1.

  1. Multiply a by c: 2 × (−3) = −6.

  2. Find two numbers that multiply to −6 and add to +5: +6 and −1.

  3. Split the middle term: 2x² + 6x − x − 3 = 0.

  4. Group in pairs: 2x(x + 3) − 1(x + 3) = 0.

  5. Factor out the common bracket: (2x − 1)(x + 3) = 0.

  6. Use the zero product property: 2x − 1 = 0 gives x = 1/2, and x + 3 = 0 gives x = −3.

The marker promised this would work: D = b² − 4ac = 25 − 4(2)(−3) = 25 + 24 = 49 = 7², a perfect square, and both roots came out rational.

How to solve quadratic equations by square root — worked on 3(x − 2)² = 12

  1. Divide both sides by 3: (x − 2)² = 4.

  2. Take the square root of both sides, with ±: x − 2 = ±2.

  3. Solve both cases: x = 4 or x = 0.

  4. Check both in the original: 3(4 − 2)² = 3 × 4 = 12, and 3(0 − 2)² = 3 × 4 = 12.

This method needs one side already a perfect square with no x term anywhere else, and that is the only reason this section opens with a different equation: the main equation has an x term, so no square root can be taken straight away. It is the single place where running everything on one equation cannot hold — the other four routes all run on x² − 3x + 1 = 0.

The property does finish the main equation, one move after completing the square: from (x − 3/2)² = 5/4, x − 3/2 = ±√(5/4) = ±√5/2, so x = 3/2 ± √5/2 = (3 ± √5)/2. Same property, same equation, just applied to a square that had to be built first.

How to solve quadratic equations by completing the square — x² − 3x + 1 = 0

  1. Move the constant to the right: x² − 3x = −1.

  2. Take half of b and square it: b = −3, half is −3/2, and (−3/2)² = 9/4.

  3. Add that to both sides: x² − 3x + 9/4 = −1 + 9/4 = 5/4.

  4. Write the left side as a square: (x − 3/2)² = 5/4.

  5. Take the square root with ±: x − 3/2 = ±√5/2.

  6. Add 3/2 to both sides: x = 3/2 ± √5/2 = (3 ± √5)/2 ≈ 2.618 or 0.382.

Step 4 is where signs go wrong: the number inside the bracket is half of b, so b = −3 gives x − 3/2, not x + 3/2. A quick way to know step 4 is right is that expanding it must give back the line above.

How to use the quadratic formula — the same equation, a = 1, b = −3, c = 1

Write the formula once:

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

  1. Substitute while keeping the signs: −b = −(−3) = 3, and b² = (−3)² = 9.

  2. x = (3 ± sqrt(9 − 4(1)(1))) / (2 × 1).

  3. x = (3 ± sqrt(5)) / 2.

  4. Two roots: (3 + 2.2360679…) / 2 = 2.6180339… and (3 − 2.2360679…) / 2 = 0.3819660…

The expression under the root sign is the discriminant, so the formula tells you what kind of answer to expect before you finish: sqrt(5) is irrational, so both roots are irrational, and no amount of factoring would have found them.

Solving by graphing, and when a sketch is the only honest answer

Sketch y = x² − 3x + 1. The vertex sits at x = −b/(2a) = 1.5, and y there is 1.5² − 3(1.5) + 1 = 2.25 − 4.5 + 1 = −1.25, so the vertex is (1.5, −1.25). Because a > 0 the parabola opens upward, and because the vertex is below the axis it crosses the axis twice — once near 0.382, once near 2.618.

That is the whole value of the graph: the count and the rough position. It cannot produce (3 ± √5)/2, and reading 2.618 off a grid does not make 2.618 the answer. The sketch earns its place in two situations. When D < 0 the honest answer is "the parabola never meets the axis", and the picture is what makes that believable. And when you want to know how many roots a problem has before doing any algebra, one glance is enough.

What the discriminant tells you: negative, zero, and perfect square

D = b² − 4ac never gives you the roots. It tells you what kind they are, which is exactly what picks the method.

  • D = 5, the main equation. Positive and not a perfect square: two real irrational roots, no integer factoring. Completing the square or the formula, and nothing else.

  • D = 0. x² − 4x + 4 = 0 gives D = 16 − 16 = 0, so (x − 2)² = 0 and x = 2. One repeated root, and the vertex sits on the axis instead of crossing it.

  • D < 0. 2x² + x + 3 = 0 gives D = 1 − 24 = −23, so there is no real solution. That is not a broken equation and not a failure: no real number makes it true, because a = 2 > 0 so the parabola opens upward and its vertex is above the axis — 2x² + x + 3 comes out positive for every real x. The two roots are complex numbers, which is a different question from a wrong answer.

  • D a perfect square. 2x² + 5x − 3 = 0 gives D = 49, and indeed (2x − 1)(x + 3), with roots 1/2 and −3.

How to check both answers by substituting them back

Put each root into the original equation and see whether zero comes out.

For x = (3 + √5)/2: x² = (9 + 6√5 + 5)/4 = (7 + 3√5)/2, and 3x = (9 + 3√5)/2. So x² − 3x + 1 = (7 + 3√5)/2 − (9 + 3√5)/2 + 1 = −2/2 + 1 = −1 + 1 = 0.

For x = (3 − √5)/2: x² = (9 − 6√5 + 5)/4 = (7 − 3√5)/2, and 3x = (9 − 3√5)/2. So x² − 3x + 1 = (7 − 3√5)/2 − (9 − 3√5)/2 + 1 = −2/2 + 1 = 0.

The decimal check is quicker and always slightly off: 2.618² = 6.8539, and 6.8539 − 7.854 + 1 = −0.0001. That gap is rounding, not error — which is why an answer left in decimals can never be checked exactly, and why a rounded answer that fails a decimal check proves nothing.

Faster than either: the two roots must add to −b/a and multiply to c/a. Here −b/a = 3, and (3 + √5)/2 + (3 − √5)/2 = 6/2 = 3. And c/a = 1, and ((3 + √5)/2) × ((3 − √5)/2) = (9 − 5)/4 = 1. Two checks, one line, both on the same roots.

What a wrong answer usually means:

  • Only one root. The ± was dropped at the square-root step, or the second bracket was never set equal to zero.

  • A sign flipped. b = −3, so −b = +3 and the formula gives (3 ± √5)/2. Writing (−3 ± √5)/2 is the commonest a/b/c slip, and substituting back catches it at once.

  • A root that does not check. Usually a, b and c were read off a form that was not standard — from x² = 3x − 1 with c taken as −1 instead of +1.

  • A missing root at x = 0. Dividing both sides by x deletes it, which ruins equations like 3(x − 2)² = 12 wherever x = 0 is a genuine root.

Paste your own equation into the solver, and read the steps instead of copying it

Worked examples stop helping the moment your equation differs from the one in the book. The math solver with steps takes your equation in the form you have it, typed as a sentence, and works it — free to try, with no sign-up.

  1. Open the AI Math Solver

    The entire input is one box with the placeholder Type or upload your question and one purple button, Solve Problem, which stays dimmed while the box is empty.

    The AI Math Solver input card at page load, with the empty question box marked 1 and the dimmed Solve Problem button marked 2
    One box, one button: type the equation, then select Solve Problem.
  2. Type your equation as a request, not as symbols

    Say what you want done: Solve x^2 = 3x - 1 by completing the square. Show the discriminant. The box takes sentences and instructions, not just symbols — the page's own third example loads "Solve the equation: x^2 + 4x + 4 = 0. Find all real solutions." into it. Write exponents as x^2, roots as sqrt(5), fractions as 1/2: the solver works in plain text with no LaTeX, and its answers come back in that notation too.

    The question box holding the typed request marked 1, with the Solve Problem button below it now enabled and marked 2
    The request names the equation, the method and the discriminant.
  3. Click Solve Problem

    While the answer is being written the button reads Solving... and the card shows a spinner with the same word.

  4. Read the [Solution] card, not only its last line

    Your own request comes back in a grey bubble at the top, then the header Fusion Chat Math Solver, then the label [Solution], then the working. It is one tutor-style reply to what you asked: name the method and ask for the discriminant and you get them, because your sentence asked for them — the tool does not decide a method behind your back. Its own FAQ describes the goal as "learning, not just answers". The copy icon copies the answer as plain text, so the working can sit next to your own attempt.

    The result card with the typed request in a grey bubble, the Fusion Chat Math Solver header, the [Solution] label and the worked steps, with the Enter New Problem button marked 1
    The working for the reader's own equation, and Enter New Problem for the next one.
  5. Start the next equation with Enter New Problem

    Enter New Problem clears the box for a fresh equation, and the re-run icon sends the same question again.

This post is the first entry in more AI Math Solver guides, the hub that lists every guide for the tool.

Frequently asked questions

How do I solve quadratic equations by factoring?
Write the equation in standard form, multiply a by c, and look for two numbers that multiply to ac and add to b. Split the middle term with them, group in pairs, factor out the shared bracket, and set each bracket to zero. On 2x² + 5x − 3 = 0 that gives −6 from a × c, the pair +6 and −1, then (2x − 1)(x + 3) = 0 and the roots x = 1/2 and x = −3. Factoring over the integers only works when the discriminant is a perfect square — here D = 49 = 7².
Which of the five methods does my equation want?
Check the shape, then the discriminant. If one side is already a perfect square with no x term elsewhere, take square roots. Otherwise compute D = b² − 4ac: a perfect square means it factors, positive but not a perfect square means completing the square or the quadratic formula, zero means one repeated root, and negative means no real roots. For x² − 3x + 1 = 0, D = 5, so the formula or completing the square is the route.
What does a negative discriminant mean?
It means no real number solves the equation. For 2x² + x + 3 = 0, D = 1 − 24 = −23. Since a = 2 > 0 the parabola opens upward and its vertex is above the axis, so it never crosses it: the expression is positive for every real x. The equation still has two roots, and they are complex numbers. "No real solution" describes the graph, not a mistake in your working.
How do I check a quadratic answer?
Substitute each root into the original equation — not into the rearranged one — and see whether zero comes out. For x² − 3x + 1 = 0, both (3 + √5)/2 and (3 − √5)/2 give exactly 0. The quicker check is that the roots must add to −b/a and multiply to c/a, so 3 and 1 for this equation. A decimal answer will only ever check to about four places, because rounding survives the substitution.
How do I get x² = 3x − 1 into standard form?
Subtract 3x from both sides and add 1, which gives x² − 3x + 1 = 0, so a = 1, b = −3 and c = 1. Both terms have to cross, and reading c as −1 is the usual slip. Fractions go away by multiplying every term by the common denominator, and a 1/x term goes away by multiplying both sides by x — which can add a root the original equation never allowed, so check any x = 0 candidate in the original.
Can I paste my own equation into the AI Math Solver?
Yes. Type the equation into the box on the tool page, phrased as a request — for example Solve x^2 = 3x - 1 by completing the square. Show the discriminant. — and click Solve Problem. The answer arrives in a card labelled [Solution] as one tutor-style reply, so the method and the discriminant appear because your sentence asked for them. Exponent notation is plain text (x^2), and typed text is the only input: the page has no image upload.

First published · Last updated : First published.