Quadratic equation solver, step by step
A quadratic equation has the form ax² + bx + c = 0, where a is not 0. Below you’ll find the three standard ways to solve one, each with a fully worked example, and a free box where Algegram solves your own equation and explains every step.
Which method should you use?
- Factoring is fastest when the numbers are small and the equation splits into whole-number brackets.
- The quadratic formula always works, including when the answers are fractions or square roots.
- Completing the square shows where the formula comes from and is useful for finding the vertex of a parabola.
Before you start, always rearrange so one side is 0. For example, x² = 3x + 4 becomes x² − 3x − 4 = 0. Then read off a, b and c, including their signs. Sign mistakes with b and c cause most wrong answers.
Three worked examples
Example 1: Solve by factoring
x² + 5x + 6 = 0
- Find two numbers that multiply to 6 and add to 5: 2 and 3For x² + bx + c, we need numbers whose product is c and whose sum is b. 2 × 3 = 6 and 2 + 3 = 5.
- (x + 2)(x + 3) = 0Write the quadratic as a product of two brackets.
- x + 2 = 0 or x + 3 = 0If two things multiply to 0, at least one of them must be 0.
- x = −2 or x = −3Solve each small equation.
Answer: x = −2 or x = −3
Check: (−2)² + 5(−2) + 6 = 4 − 10 + 6 = 0 ✓ and (−3)² + 5(−3) + 6 = 9 − 15 + 6 = 0 ✓
Example 2: Solve with the quadratic formula
2x² + 5x − 3 = 0
- a = 2, b = 5, c = −3Match the equation to ax² + bx + c = 0.
- b² − 4ac = 5² − 4(2)(−3) = 25 + 24 = 49Work out the discriminant first. It is positive, so there are two real solutions.
- x = (−5 ± √49) / (2 × 2) = (−5 ± 7) / 4Substitute into x = (−b ± √(b² − 4ac)) / 2a. √49 = 7.
- x = (−5 + 7)/4 = 2/4 = 1/2Take the + sign.
- x = (−5 − 7)/4 = −12/4 = −3Take the − sign.
Answer: x = 1/2 or x = −3
Check: 2(1/2)² + 5(1/2) − 3 = 0.5 + 2.5 − 3 = 0 ✓ and 2(−3)² + 5(−3) − 3 = 18 − 15 − 3 = 0 ✓
Example 3: Solve by completing the square
x² − 6x + 2 = 0
- x² − 6x = −2Move the constant to the right side.
- x² − 6x + 9 = −2 + 9Half of −6 is −3, and (−3)² = 9. Add 9 to both sides.
- (x − 3)² = 7The left side is now a perfect square.
- x − 3 = ±√7Take the square root of both sides, remembering ±.
- x = 3 + √7 or x = 3 − √7Add 3 to both sides. As decimals, about 5.646 and 0.354.
Answer: x = 3 ± √7
Check: (3 + √7)² − 6(3 + √7) + 2 = (16 + 6√7) − (18 + 6√7) + 2 = 0 ✓ (the − case works the same way)
The quadratic formula
For any equation ax² + bx + c = 0, the solutions are x = (−b ± √(b² − 4ac)) / 2a. The part under the square root, b² − 4ac, is called the discriminant, and it tells you what kind of answers to expect:
- Positive: two different real solutions (like Example 2, where it was 49).
- Zero: one repeated solution. For example,
x² − 4x + 4 = 0givesx = 2twice. - Negative: no real solutions. The graph never crosses the x-axis, and the solutions are complex numbers.
How to check your answer
Substitute each solution back into the original equation. If the left side comes out to exactly 0, the solution is correct. This takes under a minute and catches almost every arithmetic slip. Each example above ends with this check. A second quick test: for ax² + bx + c = 0, the two solutions always add to −b/a and multiply to c/a. In Example 2, 1/2 + (−3) = −5/2 and (1/2)(−3) = −3/2, which match −5/2 and −3/2.
Common mistakes
- Forgetting the ± and giving only one solution.
- Dividing only −b by 2a instead of the whole top of the fraction.
- Squaring a negative b wrongly: (−6)² is 36, not −36.
- Dividing both sides by x, which throws away the solution x = 0 in equations like
x² = 5x.
Solve your own quadratic with steps
Type your equation exactly as it appears in your homework, for example “solve 3x² − 2x − 8 = 0”. Algegram shows each step and the reason for it, so you can follow the method rather than just copy an answer. You can also ask it to use a specific method, like “solve by completing the square”. Working on simpler equations first? See the fraction calculator with steps.