How equations are solved: balancing, the discriminant and elimination
Why moving terms keeps an equation true, what the discriminant says about a quadratic's roots, and how elimination and Cramer's rule solve 2 or 3 equations.
Open the Equation solver Free, in your browser, nothing uploaded.
Most school equations fall into three families: linear (x on its own), quadratic (x²) and small systems of two or three equations with two or three letters. Each has a standard method, and the equation solver writes out every step of it. This article explains why those methods work. If your coefficients are awkward fractions, the fraction calculator shows that arithmetic; for systems bigger than three, use the matrix calculator; and for cubics and beyond, try polynomial zeros.
What it is
An equation says two expressions are equal. Solving means finding the values of the letter that make it true.
Linear equations: balancing. Whatever you do to one side, you do to the other, and the two sides stay equal. The solver gathers everything on one side to get the form a x + b = 0, then x = −b ÷ a. If the x terms cancel, there are two special cases: a false statement such as 2 = 0 means no solution, and 0 = 0 means every number works.
Quadratics: the discriminant. Written as a x² + b x + c = 0, the roots are
x = (−b ± √D) ÷ 2a, where D = b² − 4ac
- a, b, c are the numbers in front of x², x and the constant.
- D, the discriminant, decides the kind of answer before you finish. D > 0 and a perfect square: two whole or fraction roots, and the quadratic factorises. D > 0 but not a perfect square: two irrational roots written as surds (square roots that do not simplify to whole numbers). D = 0: one repeated root. D < 0: no real roots, but two complex roots, using i = √−1.
Systems: elimination and Cramer’s rule. With two unknowns you need two independent equations. Elimination adds or subtracts multiples of one equation from another until each letter stands alone. Cramer’s rule uses determinants, a single number worked out from a square grid of coefficients: x = Dₓ ÷ D, where D comes from the coefficients and Dₓ is the same grid with the x column replaced by the right-hand numbers. If D = 0, the equations are parallel or repeated, and there is no single answer.
How to use it
- Type an equation in the box the way you would write it, using
^for powers, or press one of the example buttons. - For a system, put each equation on its own line, up to three, with as many letters as equations.
- For a system, choose Elimination or Cramer’s rule under Method for systems.
- Read the answer: exact fractions, surds with a decimal beside them, or complex roots.
- Open Show the working to follow each step, then press Copy result.
A worked example
A linear equation. 2(x + 4) = 5x − 7. Expanding gives 2x + 8 = 5x − 7. Moving everything left: −3x + 15 = 0, so −3x = −15 and x = 5. Check: both sides equal 18.
A quadratic with surd roots. A garden bed is x metres wide, and its shape leads to 2x² − 4x − 1 = 0. Here a = 2, b = −4, c = −1, so D = 16 + 8 = 24. That is positive but not a perfect square, and √24 = 2√6. The formula gives x = (4 ± 2√6) ÷ 4, which simplifies to x = (2 ± √6) ÷ 2: about 2.2247 m or −0.2247 m. A width cannot be negative, so the bed is about 2.22 m wide.
A system. Three notebooks and two pens cost $16, and a notebook costs $2 more than a pen: 3x + 2y = 16 and x − y = 2. By Cramer’s rule, D = 3 × (−1) − 2 × 1 = −5, Dₓ = 16 × (−1) − 2 × 2 = −20 and Dᵧ = 3 × 2 − 16 × 1 = −10. So x = $4 a notebook and y = $2 a pen.
Complex roots. x² + 4 = 0 has D = −16, so x = ±2i.
Checked with the tools
Every answer above was run through the solver’s own code (src/lib/everyday/equation-solver.ts) in Node with solveText(): x = 5 with the check value 18; D = 24, √24 = 2√6 and (2 ± √6) ÷ 2 ≈ 2.2247 and −0.2247; D = −5, Dₓ = −20, Dᵧ = −10 by Cramer’s rule, and the same x = 4, y = 2 by elimination; and ±2i. While checking we fixed two display bugs: a quadratic with a negative x² term showed a negative denominator, and a surd root with no x term lost its ± sign in one step. Both are fixed.
Where it is used
- Physics. A ball thrown upward lands when height = 0, a quadratic in time; the negative root is thrown away, as with the garden bed.
- Money. Break-even points (cost = income) are linear equations; two price plans crossing is a 2-equation system.
- Mixtures. Blending two solutions to a target strength gives two equations: total amount and total substance.
Common mistakes
- Sign slips when moving terms. A term changes sign when it crosses the = sign. Write the “move everything left” line out in full.
- Using b instead of −b in the formula. If b is −4, then −b is +4. Put brackets round negative values.
- Rejecting a root without a reason. Keep both roots until the real-world meaning rules one out, like a negative width.
- Dividing both sides by x. That loses the root x = 0. Move everything to one side and factor instead.
Questions people ask
Why does a quadratic have two answers? A parabola can cross a straight line, including the x-axis, at two points. The ± in the formula gives both.
Is elimination or Cramer’s rule better? They give the same answer. Elimination works even when there is no single solution, and it is faster by hand for three equations; Cramer’s rule is neat for two.
Sources
- Standard school algebra: solving linear equations, the quadratic formula and discriminant, elimination (Gauss-Jordan) and Cramer's rule. No outside rules or rates.
If you are an author or publisher and want a credit or a passage changed or removed, tell us and we will act quickly.