What is the Solve for X Calculator?
This tool finds the value (or values) of x in two of the most common algebra problems: a linear equation of the form \(ax + b = c\) and a quadratic equation of the form \(ax^{2} + bx + c = 0\). Choose the equation type, enter the coefficients a, b, and c, and the calculator returns the exact solution along with the discriminant and the number of real roots.
How to use it
Select Linear if your equation looks like \(ax + b = c\) (the unknown appears only to the first power). Select Quadratic if it contains an \(x^{2}\) term and is written so the right side equals zero. Then type the three coefficients. Decimals and negatives are allowed. Press calculate to see x.
The formulas explained
For a linear equation, subtract b from both sides and divide by a:
$$x = \frac{c - b}{a}$$This requires \(a \neq 0\), otherwise there is no single solution.
For a quadratic, the quadratic formula gives
$$x = \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a}$$The expression under the root, \(b^{2} - 4ac\), is the discriminant. When it is positive there are two real roots, when it equals zero there is one repeated root, and when it is negative there are no real roots.
Worked example
Solve \(2x^{2} + 3x - 5 = 0\). Here \(a = 2\), \(b = 3\), \(c = -5\). The discriminant is
$$3^{2} - 4\cdot 2\cdot(-5) = 9 + 40 = 49, \quad \sqrt{49} = 7.$$So
$$x = \frac{-3 + 7}{4} = 1 \quad\text{and}\quad x = \frac{-3 - 7}{4} = -2.5.$$The two solutions are \(x = 1\) and \(x = -2.5\).
More Worked Examples: Linear, Repeated Root and No Real Roots
Example 1: Linear equation 3x + 4 = 19
- Identify the coefficients: a = 3, b = 4, c = 19.
- Use \(x = \frac{c - b}{a}\).
- Substitute: \(x = \frac{19 - 4}{3} = \frac{15}{3}\).
- Result: x = 5.
- Check: 3(5) + 4 = 15 + 4 = 19. ✓
Example 2: Repeated root, x² − 6x + 9 = 0
- Identify the coefficients: a = 1, b = −6, c = 9.
- Discriminant: \(D = b^2 - 4ac = (-6)^2 - 4(1)(9) = 36 - 36 = 0\).
- Because D = 0, there is exactly one real root (a repeated or double root).
- Quadratic formula: \(x = \frac{-b \pm \sqrt{D}}{2a} = \frac{6 \pm 0}{2} = 3\).
- Result: x = 3. Check: 3² − 6(3) + 9 = 9 − 18 + 9 = 0. ✓ The equation factors as (x − 3)² = 0.
Example 3: No real roots, x² + 2x + 5 = 0
- Identify the coefficients: a = 1, b = 2, c = 5.
- Discriminant: \(D = 2^2 - 4(1)(5) = 4 - 20 = -16\).
- Because D < 0, there are no real roots, and the parabola never crosses the x-axis. There are two complex conjugate roots.
- Substitute: \(x = \frac{-2 \pm \sqrt{-16}}{2} = \frac{-2 \pm 4i}{2}\).
- Simplify: x = −1 ± 2i.
- Check: for x = −1 + 2i, x² = 1 − 4i + 4i² = −3 − 4i. Then x² + 2x + 5 = (−3 − 4i) + (−2 + 4i) + 5 = 0. ✓
Discriminant Scenarios Compared
The sign of the discriminant \(D = b^2 - 4ac\) determines how many real roots a quadratic has and what kind they are.
| Equation | a | b | c | Discriminant | Number/type of roots | Solutions |
|---|---|---|---|---|---|---|
| x² − 5x + 6 = 0 | 1 | −5 | 6 | 25 − 24 = 1 | Two distinct real (rational, since D is a perfect square) | x = 2 and x = 3 |
| x² − 2 = 0 | 1 | 0 | −2 | 0 + 8 = 8 | Two distinct real (irrational, since D is not a perfect square) | x = ±√2 ≈ ±1.4142 |
| x² + 4x + 4 = 0 | 1 | 4 | 4 | 16 − 16 = 0 | One real, repeated (double) root | x = −2 |
| x² + x + 1 = 0 | 1 | 1 | 1 | 1 − 4 = −3 | No real roots; two complex conjugates | x = (−1 ± i√3)/2 |
Summary: D > 0 gives two real roots, D = 0 gives one repeated real root, and D < 0 gives two complex roots.
Key Terms in Solving for x
- Coefficient
- A constant number multiplying a variable. In ax² + bx + c, the values a and b are coefficients, and c is the constant term.
- Root / solution
- A value of x that makes the equation true. For a quadratic, roots are also the x-values where the graph meets the x-axis (if real).
- Linear equation
- An equation where x appears only to the first power, such as ax + b = c. It has one solution when a ≠ 0.
- Quadratic equation
- An equation where the highest power of x is 2 (a ≠ 0), such as ax² + bx + c = 0. It has up to two real roots.
- Discriminant
- The expression \(D = b^2 - 4ac\) under the square root in the quadratic formula. Its sign tells you what kind of roots exist.
- Repeated (double) root
- A root that occurs twice, which happens when D = 0. The parabola just touches the x-axis at that point.
- Real vs complex roots
- Real roots are ordinary numbers on the number line. Complex roots have the form p ± qi, where \(i = \sqrt{-1}\). They appear when D < 0.
- Standard form
- The arrangement with everything on one side. For a quadratic it is ax² + bx + c = 0, and for a linear equation it is ax + b = 0 (or ax + b = c, as used by this calculator).
FAQ
What if I enter a = 0 for a quadratic? The equation is no longer quadratic; the calculator falls back to solving the resulting linear equation \(bx + c = 0\) when possible.
Why does it say no real solution? For a quadratic, that means the discriminant is negative, so the roots are complex. For a linear equation it means \(a = 0\), which has no unique solution.
Does it handle decimals and negatives? Yes — enter any real numbers for a, b, and c.