MathPicSolver

x squared, both roots

Quadratic equation solver

Enter the equation and get the discriminant, both roots and the substitution check, one line at a time.

Find the roots ax² + bx + c = 0

Write x squared as x^2. A linear equation works too — it just comes back with one root.

What a quadratic equation is

A quadratic equation is one where the highest power of x is a square. Written in standard form it looks like ax^2 + bx + c = 0, where a is not zero. The graph of the left-hand side is a parabola, and solving the equation means finding where that parabola crosses the horizontal axis.

That crossing is why the answer is usually two numbers rather than one. A parabola curves, so it can meet the axis twice, once, or not at all.

The formula, and why the discriminant matters

The quadratic formula is x = (-b +/- sqrt(b^2 - 4ac)) / 2a. The piece underneath the square root, b^2 - 4ac, is called the discriminant, and it decides everything about the shape of the answer:

  • Positive discriminant: two distinct real roots, because the square root is a real number and both the plus and the minus give a valid result.
  • Zero discriminant: one repeated root. The plus and minus collapse into the same number, and the parabola merely touches the axis.
  • Negative discriminant: no real roots. There is no real number whose square is negative, so the parabola never reaches the axis at all.

This solver prints the discriminant as its own line, so the reason for the answer is visible before the answer arrives.

Worked example

Take x^2 - 5x + 6 = 0. Here a = 1, b = -5 and c = 6.

The discriminant is (-5)^2 - 4(1)(6) = 25 - 24 = 1. Positive, so two real roots.

The formula gives x = (5 +/- 1) / 2. That is x = 3 from the plus sign and x = 2 from the minus sign. Substituting 3 back gives 9 - 15 + 6 = 0; substituting 2 gives 4 - 10 + 6 = 0. Both hold.

Now take x^2 + 4x + 4 = 0. The discriminant is 16 - 16 = 0, so there is one repeated root at x = -2. The check gives 4 - 8 + 4 = 0.

And x^2 + x + 1 = 0 gives a discriminant of 1 - 4 = -3. Negative, so no real roots. The page states that plainly rather than producing a number that does not exist.

Getting the numbers into the solver

Write powers with a caret, so x squared is x^2. Put the whole equation in, equals sign included - the solver handles the rearranging itself and shows you the standard form it worked from. If the equation is already in ax^2 + bx + c = 0, just paste it.

Common mistakes in quadratics

  • Losing the minus sign on b. With x^2 - 5x + 6, b is minus five. Squaring it gives positive 25, which is where most sign slips happen.
  • Forgetting that a can be more than one. With 2x^2 + 3x - 2 = 0, the denominator is 2a = 4, not 2.
  • Stopping at the discriminant. It tells you how many roots exist, not what they are. Both steps are printed here.
  • Rounding too early. Keeping full precision until the final line is the difference between a clean root of 3 and an answer that reads 2.9999.

Questions students ask

What is the discriminant?

It is b squared minus 4ac, the part under the square root in the quadratic formula. Its sign tells you how many real roots exist before you compute them: positive means two, zero means one repeated root, negative means none in the real numbers.

How do I type x squared?

Use the caret: x^2. The page also accepts the symbol pasted straight in, so copying x squared from a document works too.

Why are there two answers?

The formula has a plus or minus in front of the square root. Both signs give a value that satisfies the equation, so a quadratic normally has two solutions - the two places where the parabola crosses the x-axis.

What if there is no real solution?

That happens when the discriminant is negative: the parabola never touches the x-axis. The working still shows the negative discriminant and, for completeness, the complex roots, so you can see why rather than just being told no.

Does the equation have to equal zero?

No. Anything on the right side is moved across first, and the working prints the rearranged form together with the values of a, b and c it will use.