ForHosting KIT · Math

Two-step linear equation solver

6x + 5 = 20 becomes 6x = 15 and then gives 5/2 for x, kept as an exact fraction. The solver removes the constant, divides by the coefficient and checks the answer by substitution. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Equation
6x + 5 = 20
You get
Solution
5/2
Check
6 × 5/2 + 5 = 20

This two-step linear equation solver isolates x in equations shaped like ax plus b equals c and keeps every result exact. Paste an equation such as 6x + 5 = 20, including ordinary integers, terminating decimals, or fractions. The result shows a normalized equation, the operation used to remove the constant, the division that isolates x, a reduced rational answer, and a substitution check. Because the arithmetic uses exact fractions instead of floating-point approximations, repeating answers remain trustworthy: one third stays 1/3 rather than becoming a rounded decimal. The solver is deterministic, runs without a network connection, and reports malformed or non-unique equations as clear input errors.

How a two-step equation is solved

A two-step linear equation has one variable term and one constant on the left, with a constant on the right: ax + b = c. The goal is to undo the operations around x in reverse order. First remove b by applying its inverse operation to both sides.

If b is positive, subtract b; if b is negative, add its absolute value. This produces ax = c - b while preserving equality because the same change was made on both sides. Next divide both sides by the nonzero coefficient a.

The result is x = (c - b) / a. The solver displays these transformations as ordered steps rather than returning only a final number. It also substitutes the answer into the original left side.

That final check should simplify to c, confirming that sign handling, subtraction, and division were consistent. A coefficient of zero cannot produce a unique x, so it is rejected instead of encouraging an invalid division by zero. This narrow focus makes the tool useful for learning the standard isolation method and for checking work without hiding the algebra behind a general symbolic engine.

Entering equations and reading exact results

Enter one equation with exactly one x, a signed constant term, and one equals sign. Spaces and an optional multiplication symbol before x are accepted, so 4x - 7 = 9 and 4*x-7=9 mean the same thing. You may use integers, terminating decimals, or fractions in every numeric position.

An omitted coefficient means one: x + 2 = 5 is read as 1x + 2 = 5, while -x + 2 = 5 uses a coefficient of negative one. Fractions use a slash, and their denominators must not be zero. The response includes coefficients a, b, and c as normalized reduced fractions.

The steps array records the original normalized equation, the inverse operation applied to the constant, and division by the coefficient. The check field substitutes the solution back into ax + b and shows the resulting right-hand value. The browser path uses the same pure solver logic, preserving exact output across both interfaces.

Fractions, signs, and common mistakes

Exact rational arithmetic matters whenever division does not terminate neatly in decimal notation. In 3x + 2 = 3, subtracting 2 gives 3x = 1, so the exact solution is 1/3. Converting that value early to 0.333 or a long floating approximation makes the substitution check imperfect and can cause later calculations to drift.

This solver instead stores every parsed decimal or fraction as an integer numerator over an integer denominator, reduces intermediate results by their greatest common divisor, and emits a reduced fraction. Pay close attention to negative constants. In 5x - 7 = 18, the first isolation step adds 7 to both sides; subtracting negative 7 is addition.

Negative coefficients are also valid, and dividing by one changes no value while dividing by negative one reverses the sign. Avoid adding an extra x term on the right or using parentheses, powers, or inequalities: those belong to broader equation tools and are intentionally outside this focused grammar. When checking homework, compare each inverse operation before comparing only the answer.

A correct final fraction reached through incorrect cancellation may hide a conceptual mistake. For automated use, inspect the structured numerator and denominator instead of parsing the displayed step text.

Check algebra homework

Compare each handwritten isolation step with an exact worked solution, including negative constants and fractional answers.

Create answer keys

Turn a set of two-step equations into stable reduced rational answers and readable checks without floating-point drift.

Validate learning software

Use structured numerators and denominators as deterministic expected values in quizzes, exercises, and automated grading tests.

What is a two-step linear equation?

It is an equation such as ax + b = c that usually requires removing the constant b and then dividing by coefficient a to isolate x.

Does the solver return exact fractions?

Yes. Integer, terminating-decimal, and fractional inputs are converted to reduced rational values, and the answer is never replaced by a floating approximation.

Can the coefficient of x be omitted?

Yes. An equation beginning with x uses coefficient 1, while an equation beginning with -x uses coefficient -1.

Why is a zero coefficient rejected?

When a is zero, the equation cannot have one unique solution for x. It is either always true or contradictory, so it is outside this unique-solution tool.

How can I check the answer of a two-step equation?

Put the answer back into the left side and simplify. For 6x + 5 = 20 the answer is 5/2, and 6 × 5/2 + 5 gives 20, so the result is confirmed.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/algebra/two-step-linear-equation

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/algebra/two-step-linear-equation \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"equation":"6x + 5 = 20"}'
{
  "equation": "6x + 5 = 20"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.two_step_linear_equation",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

How a two-step equation is solved

For example, 6x + 5 = 20 becomes 6x = 15 and then x = 15/6 = 5/2.

Entering equations and reading exact results

The solution field is the compact exact answer, while exact_rational separates its numerator and denominator for software that needs structured values. Inputs outside this grammar, equations containing multiple variable terms, and zero coefficients return invalid_input. A successful API request costs $0.002; validation failures are not presented as invented answers.

How much does the solver cost?

The browser solver is free. Each successful API request costs $0.002, while invalid input returns an error rather than a fabricated result.

Read the full KIT documentation →