Equation Solver

Solve linear and quadratic equations, or small systems of equations, with step-by-step explanations and a numeric root finder for general equations of the form f(x) = 0.

Use x as the variable and ^ for powers (e.g., x^2). You can also enter equations like sin(x) - x/2 = 0 for the numeric solver.

Used only for the numeric solver.

Smaller values require more iterations.

The solution and step-by-step explanation will appear here.

How this equation solver works

This tool is designed for core algebra and pre-calculus work. It combines exact algebraic formulas for linear and quadratic equations with a numeric solver for more general problems, plus a compact linear system solver for small systems.

1. Linear equations in one variable

A linear equation in one variable has the form ax + b = c, where a, b, and c are real numbers and a ≠ 0.

Solving a linear equation:

Start from: ax + b = c

Subtract b from both sides: ax = c - b

Divide by a: x = (c - b) / a

2. Quadratic equations

A quadratic equation has the form ax^2 + bx + c = 0 with a ≠ 0. The solutions are given by the quadratic formula.

Quadratic formula:

Given ax^2 + bx + c = 0, define the discriminant D = b^2 - 4ac.

  • If D > 0, there are two distinct real roots.
  • If D = 0, there is one repeated real root.
  • If D < 0, the roots are complex conjugates.

The roots are: x = (-b ± √D) / (2a)

3. Numeric solver (Newton–Raphson)

For equations that cannot be easily solved symbolically, we treat the problem as finding a root of a function f(x) = 0. The numeric solver uses the Newton–Raphson iteration:

x_{n+1} = x_n - f(x_n) / f'(x_n)

The derivative f'(x) is approximated numerically, and the process continues until the change between iterations is smaller than the specified tolerance or the maximum number of iterations is reached.

4. Systems of linear equations

For systems, we represent the equations as a matrix equation Ax = b, where A is the coefficient matrix, x is the vector of unknowns, and b is the constants vector. The solver uses a simple Gaussian elimination algorithm with partial pivoting for stability.

Example (2 × 2 system):

a₁₁x + a₁₂y = b₁

a₂₁x + a₂₂y = b₂

Under the condition that the determinant det(A) = a₁₁a₂₂ - a₁₂a₂₁ ≠ 0, the system has a unique solution.

Tips for reliable results

  • Use consistent notation: x as the unknown, ^ for powers, and parentheses for grouping.
  • For the numeric solver, choose an initial guess close to where you expect a root.
  • If the solver reports that the system is singular or nearly singular, your equations may be dependent or inconsistent.

Equation Solver – FAQ