CalclityCalclity

Linear Equation Solver

Solve linear equations and simplify linear expressions. Solve systems of equations by Gauss-Jordan elimination, substitution or Cramer's rule, and linear differential systems x′ = Ax. Exact fractions and full steps.

Type one linear equation, such as 3(x − 2) + 5 = 2x − 7. Leave out the = sign to simplify a linear expression. Brackets, fractions, decimals, * and / are allowed.

Try:

The Mathematics Behind the Solver

One linear equation

A linear equation in one unknown can always be brought to the form ax = b. If a ≠ 0, the only solution is x = b/a. If a = 0, the equation reads 0 = b. It holds for every x when b = 0 (an identity) and for no x when b ≠ 0 (a contradiction). The solver works with exact fractions, so 1/3 stays 1/3 and is never rounded to 0.333333.

Systems of linear equations

Write the system as Ax = b. Gauss-Jordan elimination uses three row operations: swap two rows, multiply a row by a nonzero number, and add a multiple of one row to another. None of them changes the solution set. By the Rouché-Capelli theorem, the system has a solution exactly when rank(A) = rank([A | b]), and the solution is unique exactly when this rank equals the number of unknowns. Substitution and Cramer's rule, xᵢ = det(Aᵢ)/det(A), give the same answer when A is square and det(A) ≠ 0.

Linear systems of differential equations

For X′ = AX with a constant 2 × 2 matrix A, try X = e^(λt)v. This works exactly when Av = λv, so λ must be a root of λ² − (trace A)λ + det A = 0. Two different real eigenvalues give c₁e^(λ₁t)v₁ + c₂e^(λ₂t)v₂. Complex eigenvalues α ± βi give solutions with e^(αt)cos βt and e^(αt)sin βt. A repeated eigenvalue with only one eigenvector adds a term with t·e^(λt). The signs of the trace, the determinant and the discriminant decide if the origin is a node, a saddle, a spiral or a center.

Disclaimer: This calculator performs standard mathematical operations for general and educational use only. We are not a substitute for professional review — for calculations where accuracy is critical, such as financial filings, engineering work, or academic submissions, please verify the result independently.

Frequently Asked Questions

About this calculator

This linear equation solver works on three kinds of problems. It solves a single linear equation, or a linear equation for one chosen unknown, and it simplifies linear expressions. It solves systems of linear equations (simultaneous equations) with up to 8 equations and 8 unknowns, by Gauss-Jordan elimination, by substitution or by Cramer's rule. It also finds the solution of a linear system of differential equations x′ = Ax for a 2 × 2 matrix A. All arithmetic uses exact fractions, and every answer comes with its steps.

What is a linear equation?

An equation is linear when each unknown appears only to the first power and is multiplied only by numbers. So 3x + 2y = 7 and x/2 − 1 = 4(x + 3) are linear, but x² = 4, xy = 6 and 1/x = 2 are not. Every linear equation in n unknowns can be written as a₁x₁ + a₂x₂ + … + aₙxₙ = b. With one unknown this is ax = b. With two unknowns the graph is a straight line, and this is where the name comes from.

How to solve one linear equation

  • Expand the brackets and combine like terms on each side.
  • Move the terms with the unknown to one side and the numbers to the other side. Adding or subtracting the same thing on both sides does not change the solutions.
  • Divide both sides by the coefficient of the unknown.
  • Check the answer by putting it back into the original equation.

For example, 3(x − 2) + 5 = 2x − 7 becomes 3x − 1 = 2x − 7, so x = −6. Check: 3(−6 − 2) + 5 = −19 and 2(−6) − 7 = −19.

If the unknown cancels, two cases are left. 2(x + 1) = 2x + 5 reduces to 2 = 5, which is never true, so there is no solution. 2(x + 1) = 2x + 2 reduces to 2 = 2, which is always true, so every real number is a solution.

If you type an expression without an = sign, such as 4(2a − 1) − 3(a + 2), the calculator simplifies it to 5a − 10 and tells you where it equals 0 (a = 2). An equation with two unknowns, such as 2x + 3y = 12, can be solved for either one. Solved for y it gives y = 4 − 2x/3: a line with slope −2/3 that crosses the y-axis at 4.

Systems of linear equations

A system of linear equations is a set of linear equations that must all be true at the same time. A solution is a value for every unknown that makes each equation true. There are only three possible outcomes: exactly one solution, no solution, or infinitely many solutions. With two unknowns you can see this in the graph. The two lines meet in one point, are parallel, or are the same line.

Gauss-Jordan elimination

The calculator writes the system as an augmented matrix [A | b] and uses row operations until the matrix is in reduced row echelon form. Every step is shown with the matrix after it. The ranks then decide the case (Rouché-Capelli theorem). If rank(A) < rank([A | b]), one row reads 0 = c with c ≠ 0 and there is no solution. If rank(A) = rank([A | b]) = n, the number of unknowns, the solution is unique. Otherwise n − rank(A) unknowns are free, and the others are written in terms of them.

Substitution

Solve one equation for one unknown, put that expression into the other equations, and repeat until one unknown is left. Then substitute back. The solver picks an unknown with coefficient 1 or −1 when it can, because this keeps the fractions small. For x + y = 10 and x − y = 2, the first equation gives x = 10 − y. Then (10 − y) − y = 2, so y = 4 and x = 6.

Cramer's rule

For a square system with det(A) ≠ 0, each unknown is xᵢ = det(Aᵢ)/det(A), where Aᵢ is A with column i replaced by b. This is a closed formula, but for large systems it needs far more operations than elimination. It is most useful for 2 × 2 and 3 × 3 systems.

Linear systems of differential equations

The third tab solves x′ = ax + by, y′ = cx + dy, written X′ = AX, by the eigenvalue method. The eigenvalues are the roots of the characteristic equation λ² − (a + d)λ + (ad − bc) = 0.

  • Two different real eigenvalues λ₁ and λ₂ with eigenvectors v₁ and v₂ give X(t) = c₁e^(λ₁t)v₁ + c₂e^(λ₂t)v₂.
  • One repeated eigenvalue λ with only one eigenvector v gives X(t) = c₁e^(λt)v + c₂e^(λt)(tv + w), where (A − λI)w = v.
  • Complex eigenvalues α ± βi with eigenvector p + iq give X(t) = c₁e^(αt)(p cos βt − q sin βt) + c₂e^(αt)(p sin βt + q cos βt).

If you enter x(0) and y(0), the calculator finds c₁ and c₂ and writes out x(t) and y(t). It also names the type of equilibrium at the origin (saddle, node, spiral or center) and draws a phase portrait. For example, A = [1 2; 2 1] has eigenvalues 3 and −1 with eigenvectors (1, 1) and (1, −1). With x(0) = 1 and y(0) = 0, the solution is x(t) = (1/2)e^(3t) + (1/2)e^(−t) and y(t) = (1/2)e^(3t) − (1/2)e^(−t).

Where linear equations are used

  • Prices and mixtures: 3 apples and 2 pears cost 4.10, and 1 apple and 4 pears cost 4.70. The system 3a + 2p = 4.10, a + 4p = 4.70 gives p = 1.00 and a = 0.70.
  • Break-even point: with costs of 500 + 12x and revenue of 32x, the two are equal when 20x = 500, so at x = 25 units.
  • Electric circuits: Kirchhoff's laws give one linear equation for each loop and each junction. Solving the system gives the currents.
  • Coupled change: two connected tanks of salt water, two interacting populations near equilibrium, and a mass on a spring all lead to a system X′ = AX.
  • Exact fractions — All arithmetic is exact, so answers such as x = 7/3 stay exact, with a decimal value next to them.
  • Three methods for systems — Solves systems of up to 8 equations in 8 unknowns by Gauss-Jordan elimination, substitution or Cramer's rule, and shows every step.
  • Every case covered — Finds a unique solution, shows when there is no solution, and gives the general solution with free unknowns when there are infinitely many. The ranks are shown too.
  • Expressions and lines — Simplifies linear expressions, solves an equation for any unknown, and gives the slope, intercept and graph of a two-unknown equation.
  • Differential systems x′ = Ax — Gives eigenvalues, eigenvectors, the general solution, the solution for given initial values, the type of equilibrium and a phase portrait.