ForHosting KIT · Math

Absolute value equation solver

The equation |2x − 4| = 10 splits into two linear equations whose solutions are −3 and 7. Enter a, b and c of |ax + b| = c to see every real solution, including the cases with one answer, none or infinitely many. 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
A
2
B
-4
C
10
You get
Equation
|2x + -4| = 10
Solutions
-3, 7
Solution count
2

An absolute value equation like |2x − 4| = 10 looks small but hides a fork: the expression inside the bars can be either positive or negative, so one equation is really two linear equations in disguise. This absolute value equation solver takes the three coefficients a, b and c of |ax + b| = c and returns every real solution, distinguishing the four cases that matter: two solutions, exactly one, none at all when c is negative, and infinitely many when a is zero and |b| equals c.

Why one equation becomes two

The absolute value of a number is its distance from zero, so saying |ax + b| = c really says the quantity ax + b sits exactly c units away from zero. When c is positive, that happens in two places: ax + b = c or ax + b = −c. Each branch is an ordinary linear equation, solved by isolating x, which gives x = (−b + c)/a on one side and x = (−b − c)/a on the other.

The absolute value equation solver performs exactly this split for you, then sorts the two roots ascending so the output is stable and easy to compare against a textbook answer. Both are returned, and you can verify each by substituting it back into the original expression. This is the same procedure taught in algebra courses, just executed without sign slips: the most common student mistake is forgetting the negative branch entirely, which loses half the solution set.

Automating the split removes that whole class of error.

The edge cases: one solution, none, or infinitely many

Not every absolute value equation has two answers, and a solver that always returns two roots is wrong often enough to be dangerous. When c is negative, there is nothing to find at all: an absolute value is a distance and a distance cannot be negative, so |3x + 1| = −2 has no real solutions, and the solver says so with an empty list rather than inventing numbers. Covering these four cases explicitly is what separates a correct solver from a quadratic-formula-style guess.

Check homework answers automatically

A tutoring app sends a, b and c from each generated exercise and compares the student's answer against the exact solution set.

Solve tolerance problems in engineering

Equations like |x − target| = tolerance appear in calibration and machining; get the boundary values directly from the coefficients.

What forms of equation does it accept?

Exactly |ax + b| = c, given as the three numeric coefficients a, b and c. Rearrange other forms into this one first.

What happens when a is zero?

If |b| equals c, every real number is a solution and the response reports infinitely many.

Are the results exact?

Yes. The solve is a direct algebraic rearrangement with no iterative approximation; roots are rounded to ten decimal places only so results are identical on every machine.

Is anything I send stored?

No. The three coefficients are processed in memory and discarded; only the solution set is returned.

What if c is negative?

Then there is no real solution, because an absolute value is a distance and a distance cannot be negative. The solver returns an empty list, so an equation such as |3x + 1| = −2 is reported as having no answer.

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/math/absolute-value-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/math/absolute-value-equation \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a":2,"b":-4,"c":10}'
{
  "a": 2,
  "b": -4,
  "c": 10
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.absolute_value_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.

It runs deterministically, with no approximation methods, so the answer you test in the browser is the same answer the API returns.

Why one equation becomes two

Take |2x − 4| = 10: the branches are 2x − 4 = 10 and 2x − 4 = −10, giving x = 7 and x = −3.

The edge cases: one solution, none, or infinitely many

When c equals zero, the two branches collapse into the single equation ax + b = 0, so there is exactly one solution at x = −b/a; |x + 3| = 0 is satisfied only by x = −3. The trickiest case is a = 0, where x disappears from the equation entirely. If |b| happens to equal c, every real number is a solution and the solver reports infinitely many; otherwise the equation is a contradiction like |5| = 3 and the call is rejected as invalid input, because a coefficient set that cannot involve x is a modelling mistake, not a solvable problem.

Using the API and interpreting the output

You send three numbers — a, b and c — and receive the reconstructed equation, the coefficients echoed back, and the solution set. When the solution set is empty you still get a successful response with an empty list, because 'no real solutions' is a valid mathematical answer, not an error. Typical integrations are tutoring backends checking student answers, symbolic pre-processors, and validation of generated exercise sets. The solutions field is a list of real numbers rounded to ten decimal places so that results are byte-identical across machines and safe to snapshot in tests; solution_count tells you how many there are without counting elements. When a is zero and |b| equals c, the response carries infinite_solutions instead of a list. Only genuinely malformed requests are rejected: a missing or non-numeric coefficient, a non-finite value like Infinity, or the contradictory a = 0 case described above.

Validate generated exercise sets

A content pipeline rejects any generated |ax+b|=c item that accidentally has no real solutions or a degenerate a = 0 before it reaches students.

What does it cost?

$0.002 per request via the API. It is also free to run in your browser on this page.

What happens when c is negative?

The call succeeds and returns an empty solution list: an absolute value cannot equal a negative number, so there are no real solutions.

Read the full KIT documentation →