Xerobit

Linear Equation Solver: Find X Step by Step

Enter a linear equation like 2x + 5 = 13 or an expression with two variables like 3x + 2y = 12 to see the solution and every algebraic step. This equation solver runs entirely in your browser, so nothing is uploaded to a server.

Result

  • Solution
    x = 4
  • Steps
    Original equation: 2x + 5 = 13 → Combine like terms: 2x = 8 → Divide both sides by 2 → x = 4

How to use the linear equation solver

  1. Type your linear equation into the input field using x (and optionally y) as variables.
  2. The equation solver parses the expression automatically and identifies coefficients on each side.
  3. For one variable, it isolates x by combining like terms and dividing.
  4. For two variables, it rearranges the equation to express y in terms of x.
  5. Review the step-by-step breakdown below the result to follow the algebraic logic.

How the equation solver works

A linear equation contains variables raised only to the first power. To solve ax + b = cx + d, the solver moves all x terms to one side and constants to the other. The formula becomes (a - c)x = d - b, so x = (d - b) / (a - c).

Consider the equation 5x - 3 = 2x + 9. Subtracting 2x from both sides gives 3x - 3 = 9. Adding 3 yields 3x = 12. Dividing by 3 produces x = 4. Every step preserves equality, which is why the method works for any linear expression.

Solving equations with two variables

When an equation has both x and y, such as 3x + 2y = 12, there is no single numeric answer. Instead, this equation solver isolates one variable. Solving for y means subtracting 3x to get 2y = -3x + 12, then dividing by 2 to produce y = -1.5x + 6.

This form is called slope-intercept form. It tells you that for every increase of 1 in x, y decreases by 1.5, and when x is zero, y equals 6. If you need to find specific pairs where two different lines intersect, use the system of equations solver instead.

Common forms of linear equations

Linear equations appear in several standard arrangements. Recognizing them helps you verify results quickly.

FormExampleNotes
Standard (one variable)ax + b = 0Solution is x = -b/a
Variables both sidesax + b = cx + dCombine like terms first
Standard (two variables)ax + by = cOften rearranged to slope-intercept
Slope-intercepty = mx + bm is slope, b is y-intercept
Point-slopey - y1 = m(x - x1)Uses a known point and slope

Edge cases and special situations

Not every linear equation has exactly one solution. When simplifying leads to a statement like 0 = 5, the equation is a contradiction and has no solution. This happens when the lines are parallel but distinct, such as x + 1 = x + 2.

Conversely, if simplification produces 0 = 0, the equation is an identity. Any value of the variable satisfies it, meaning there are infinitely many solutions. An example is 2x = 2x. A reliable equation solver must detect both conditions rather than attempting to divide by zero.

Practical uses for linear equations

Linear equations model countless real-world relationships. In budgeting, if you earn a fixed hourly wage plus a base stipend, your total pay follows y = mx + b where m is the hourly rate and b is the stipend. Solving for x tells you how many hours you need to reach a target income.

In physics, uniform motion uses d = rt (distance equals rate times time), which is linear. Converting temperatures between Celsius and Fahrenheit relies on F = 1.8C + 32. Whenever a relationship changes at a constant rate, a linear equation describes it, and solving that equation answers practical questions about thresholds, break-even points, and required quantities.

Worked examples

Each result below was produced by the same code the tool runs, so you can check your own numbers against them.

ExampleInputResult
Simple one-variableEquation: 2x + 5 = 13Solution: x = 4; Steps: Original equation: 2x + 5 = 13 → Combine like terms: 2x = 8 → Divide both sides by 2 → x = 4
Variables on both sidesEquation: 5x - 3 = 2x + 9Solution: x = 4; Steps: Original equation: 5x - 3 = 2x + 9 → Combine like terms: 3x = 12 → Divide both sides by 3 → x = 4
Negative coefficientEquation: -4x + 10 = 2Solution: x = 2; Steps: Original equation: -4x + 10 = 2 → Combine like terms: -4x = -8 → Divide both sides by -4 → x = 2
Two variables (solve for y)Equation: 3x + 2y = 12Slope-intercept form: y = -1.5x + 6; Slope (m): -1.5 (-3/2); Y-intercept (b): 6 (6); X-intercept: 4; Steps: Original equation: 3x + 2y = 12 → Rearrange to isolate y: 2y = -3x + 12 → Divide by 2 → y = -1.5x + 6
FractionsEquation: x/2 + 3 = 7Solution: x = 8; Steps: Original equation: x/2 + 3 = 7 → Combine like terms: 0.5x = 4 → Divide both sides by 0.5 → x = 8

FAQ

What types of equations can this solver handle?

This tool handles linear equations where variables are raised only to the first power. It supports one variable (solving for x) or two variables (expressing y in terms of x). For quadratic or higher-degree polynomials, you would need a different approach.

Can I type expressions like 2x without a multiplication sign?

Yes. The parser recognizes implicit multiplication, so 2x, 3y, and even 2(x+1) are interpreted correctly. You can also write 2*x if you prefer explicit notation.

What happens if the equation has no solution?

If simplifying the equation results in a false statement like 0 = 5, the solver reports that there is no solution. This occurs when the coefficients of the variable cancel out but the constants do not match.

Does this replace a system of equations solver?

No. This tool solves a single linear equation. If you have two or more equations that must be satisfied simultaneously, use the dedicated system of equations solver to find the intersection point.

Are fractions and decimals supported?

Yes. You can enter decimals like 0.5x + 1.2 = 3.7 or fractions written as division like x/3 + 2 = 5. The solver computes exact fractional results internally and displays them as simplified decimals or fractions.

Is my data sent to a server?

No. All parsing and calculation happen locally in your browser using JavaScript. Nothing you type is transmitted anywhere.