Solve for x Step by Step — Linear, Quadratic & Cubic
Last reviewed: April 2026
Solve linear, quadratic, and cubic equations step by step. Enter any equation and get the solution with full work shown. Free algebra equation solver. This calculator runs entirely in your browser — your data stays private, and no account is required.
Enter any equation with an equals sign and this tool will solve for x using standard algebraic techniques. It handles linear equations (like 2x + 5 = 11), quadratic equations (like x² − 5x + 6 = 0), and cubic equations (like x³ − 6x² + 11x − 6 = 0). Each solution includes step-by-step work so you can follow the process and verify your own algebra. For specifically quadratic problems, our dedicated Quadratic Equation Solver offers additional detail on the discriminant and vertex.
A linear equation has the form ax + b = c. The solver isolates x by moving constants to one side and dividing by the coefficient. It also handles equations with x on both sides (like 3x − 7 = 2x + 4) by first moving all x terms to the left and all constants to the right. Linear equations always have exactly one solution (unless the equation is an identity or a contradiction).
Quadratic equations (degree 2) are solved using the quadratic formula: x = (−b ± √(b²−4ac)) / 2a. The discriminant (b²−4ac) determines the number of solutions: positive means two real roots, zero means one repeated root, and negative means no real solutions (only complex roots). The solver shows the discriminant calculation and each root individually. For graphing these parabolas, use our Graphing Calculator.
Cubic equations (degree 3) are solved using the Rational Root Theorem to find integer or fractional roots, then synthetic division to reduce the cubic to a quadratic. This approach finds exact solutions when rational roots exist. For cubics with only irrational roots, numerical methods would be needed. The solver currently handles polynomials up to degree 3. For matrix-based systems, see the Matrix Calculator.
| Equation Type | General Form | Solution Method | Example |
|---|---|---|---|
| Linear | ax + b = 0 | x = -b/a | 3x + 6 = 0 → x = -2 |
| Quadratic | ax² + bx + c = 0 | Quadratic formula | x² - 5x + 6 = 0 → x = 2, 3 |
| System (2 var) | ax + by = c | Substitution/elimination | x + y = 5, x - y = 1 |
| Exponential | aⁿ = b | Logarithms | 2ˣ = 16 → x = 4 |
An equation is a mathematical statement asserting that two expressions are equal, and solving it means finding the values of unknown variables that make the statement true. Equations range from simple linear relationships to complex systems requiring advanced techniques — understanding which method to apply to each type is the foundation of mathematical problem-solving.
Single-variable linear equations (ax + b = c) are solved by isolating x through inverse operations: subtract b from both sides, then divide by a. Example: 3x + 7 = 22 → 3x = 15 → x = 5. The key principle is performing identical operations on both sides to maintain equality. Two-variable linear systems (two equations with two unknowns) are solved by substitution (solve one equation for a variable, substitute into the other), elimination (add or subtract equations to cancel one variable), or graphing (the solution is where the lines intersect). A system can have one solution (lines intersect), no solution (parallel lines), or infinitely many solutions (same line). Multi-variable systems (three or more equations) extend these methods or use matrix techniques like Gaussian elimination and Cramer's rule.
Quadratic equations (ax² + bx + c = 0) have up to two solutions, found through several methods. Factoring: Express the quadratic as a product of two binomials — works when factors are integers but not always possible. Example: x² − 5x + 6 = 0 → (x−2)(x−3) = 0 → x = 2 or x = 3. Quadratic formula: x = (−b ± √(b²−4ac)) / 2a — works for all quadratics. The discriminant (b²−4ac) determines the nature of solutions: positive = two real solutions, zero = one repeated solution, negative = two complex (imaginary) solutions. Completing the square: Rearrange the equation into perfect square form — this technique is the foundation for deriving the quadratic formula and is essential for converting between standard and vertex forms of parabolas.
Higher-degree polynomials (cubic, quartic, quintic, and beyond) require increasingly sophisticated techniques. Cubic equations can have 1 or 3 real roots and are solvable by formula (Cardano's formula, published 1545). Quartic equations (degree 4) are solvable by formula (Ferrari's method). Quintic and higher (degree 5+) have no general algebraic formula — proven impossible by the Abel-Ruffini theorem in 1824. These are solved numerically using methods like Newton-Raphson iteration, synthetic division with rational root testing, or computer algebra systems. The Fundamental Theorem of Algebra guarantees that every polynomial of degree n has exactly n roots (counting multiplicity and complex roots), providing a useful check on solution completeness.
Equations involving trigonometric, exponential, or logarithmic functions alongside algebraic terms are called transcendental and generally cannot be solved in closed form. Example: e^x = 3x has no algebraic solution — it must be solved numerically or graphically. Common approaches include Newton's method (iterative approximation using tangent lines), bisection method (narrowing a bracketed interval containing the root), and graphical intersection (plotting both sides and finding crossing points). Many scientific and engineering problems produce transcendental equations, making numerical methods essential practical tools.
When multiple equations involve products, powers, or transcendental functions of the unknowns, the system is nonlinear. Example: x² + y² = 25 and y = x + 1 (a circle and a line). Substitution often works for simple cases: replace y with (x+1) in the circle equation, solve the resulting quadratic, then back-substitute. More complex nonlinear systems require iterative numerical methods — multidimensional Newton's method being the most common. These systems arise frequently in physics (equilibrium problems), economics (market equilibrium with nonlinear supply and demand), and engineering (thermal, fluid, and structural analysis).
The most frequent errors in equation solving include sign errors when distributing negative signs or moving terms across the equals sign, dividing by zero (never divide both sides by an expression that could equal zero — this eliminates valid solutions), extraneous solutions introduced by squaring both sides (always check solutions in the original equation), and domain restrictions in equations involving logarithms (argument must be positive), square roots (radicand must be non-negative), or fractions (denominator cannot be zero). Developing the habit of checking your answer by substituting back into the original equation catches these errors before they propagate through longer problems.
Knowing how to solve equations by hand develops mathematical intuition that no calculator can replace. However, for practical problem-solving in professional and academic contexts, computer algebra systems (CAS) like Wolfram Alpha, MATLAB, Mathematica, and Python's SymPy library solve equations symbolically and numerically with speed and accuracy that hand calculation cannot match. The value of hand-solving lies in understanding what the solution means, identifying when software produces incorrect or incomplete results, and building the conceptual framework needed to set up problems correctly before handing them to a solver. A common workflow: derive the equation from the physical or financial scenario (the creative, human-driven step), then solve it with technology (the mechanical step), and finally interpret the result in context. This calculator handles the middle step instantly for the most common equation types encountered in algebra, precalculus, and introductory physics and engineering courses.
See also: Matrix Determinant Calculator · Quadratic Solver · Graphing Calculator · Matrix Calculator · Scientific Calculator · Logarithm Calculator · Slope Calculator
→ Linear equations have exactly one solution. Any equation in the form ax + b = c has one solution: x = (c - b) / a. The only exceptions: 0x = 0 (infinite solutions) and 0x = 5 (no solution). These edge cases represent parallel or identical lines.
→ Quadratic equations have 0, 1, or 2 real solutions. The discriminant (b² - 4ac) determines which: positive = 2 real solutions, zero = 1 repeated solution, negative = 2 complex solutions. The quadratic formula x = (-b ± √(b²-4ac)) / 2a always works.
→ Factor when possible — it's faster than the formula. x² + 5x + 6 = 0 factors to (x+2)(x+3) = 0, giving x = -2 or x = -3 instantly. Look for two numbers that multiply to c and add to b. Save the quadratic formula for when factoring isn't obvious.
→ Always check for extraneous solutions. When you square both sides of an equation or work with rational expressions, you can introduce solutions that don't satisfy the original equation. Verify every answer by substituting back. See our Quadratic Solver for dedicated quadratic analysis and Graphing Calculator to visualize solutions.
See also: Quadratic Solver · Graphing Calculator · Scientific Calculator · Slope Calculator