Absolute value inequality solver
|2x − 4| < 10 holds for every x strictly between −3 and 7. Enter a, b, c and the comparison sign to get the interval, or the two outer rays for greater-than, with open or closed ends marked. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 2
- B
- -4
- C
- 10
- Op
- <
- Inequality
- |2x + -4| < 10
- Solution type
- interval
You send the three coefficients a, b and c plus the comparison operator, and you get back ordered, rounded bounds ready to render on a number line or feed into the next step of a pipeline. It replaces the error-prone hand algebra of splitting |ax+b| into two cases, especially when a is negative and the interval bounds have to be swapped.
How an absolute value inequality is solved
An inequality like |ax + b| < c says that the quantity ax + b stays within a distance c of zero, so it is equivalent to the compound inequality -c < ax + b < c. Subtracting b and dividing by a isolates x, but there is a catch that breaks most hand solutions: when a is negative, dividing flips both comparison signs, and the two raw bounds end up in the wrong order.
The solver computes both raw bounds, (-c - b)/a and (c - b)/a, and then orders them explicitly, so the sign of a never leaks into the answer. For < and <= the solution is the single interval between those bounds, reported with open or closed ends to match the operator. For > and >= the solution is the complement: every x below the lower bound or above the upper one, returned as two rays.
Each bound is rounded to ten decimal places so results are byte-stable across machines and safe to snapshot in tests.
Input validation and when you get an error
The first is a equal to zero: with no x left inside the absolute value, the problem is no longer an inequality in x at all, and returning an interval would be a lie — either every x or no x satisfies it depending on b and c, which is a different question entirely. The second is a negative c: an absolute value is never negative, so comparing it against a negative right-hand side is treated as a malformed problem rather than silently answered.
Every coefficient must also be a finite number; NaN, infinities and strings are rejected field by field with a message naming the culprit. Requests that fail validation are not charged.
What you can do with it
Homework and textbook checking
Verify a hand-solved |ax+b| < c exercise, including the tricky case where a is negative and the interval bounds must be swapped.
Tolerance band computation
Turn a measurement tolerance like |3x - 12| <= 6 into exact lower and upper bounds for a validation rule or a control chart.
FAQ
What does it cost?
The same solver also runs free in your browser on this page, so manual checks cost nothing.
Which operators are supported?
All four comparisons: <, <=, > and >=, passed in the op field. It defaults to < when omitted.
What happens when c is negative?
An absolute value is never negative, so the problem has no meaningful interval formulation and is treated as malformed rather than silently answered.
Are the results exact?
Yes, within floating-point arithmetic. Bounds are computed analytically — no iterative approximation — and rounded to ten decimal places so identical inputs always return identical output.
Why do the bounds swap when a is negative?
Dividing by a negative number flips both comparison signs, so the raw bounds come out in the wrong order. The solver orders them explicitly, so a negative a never puts the lower bound on top.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/absolute-value-inequalities \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":2,"b":-4,"c":10}'const res = await fetch("https://api.kit.forhosting.com/math/absolute-value-inequalities", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 2,
"b": -4,
"c": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/absolute-value-inequalities",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 2,
"b": -4,
"c": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/absolute-value-inequalities", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":2,"b":-4,"c":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":2,"b":-4,"c":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/absolute-value-inequalities", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 2,
"b": -4,
"c": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.absolute_value_inequalities",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The absolute value inequalities API takes an inequality of the form |ax+b| < c — with <, <=, > or >= — and returns its exact solution set over the real numbers as one interval, a union of two rays, a single point, or the empty set.
The four operators and their solution shapes
Two degenerate shapes are worth knowing. Each comparison operator produces a characteristic shape, and the response names it in the solution_type field so your code does not have to guess from the raw numbers. A strict or non-strict less-than yields solution_type interval: one bounded piece of the number line, open ends for < and closed ends for <=. Greater-than operators yield solution_type union: two outward rays, for example x < -1 or x > 5. When c is zero, <= collapses to the single point x = -b/a, reported as solution_type point, while < collapses to nothing at all, reported as solution_type empty with an empty interval list. When c is zero with a greater-than operator, every real number except -b/a works, reported as solution_type all_except_point with the excluded value in excluded_point. Unbounded ray ends are simply omitted from the interval objects rather than set to null, which keeps the JSON clean to consume.
Input validation and when you get an error
Two inputs are rejected with a typed invalid_input error instead of a misleading answer. When you are prototyping you can run the exact same code free in the browser on this page, and only the automated API calls cost $0.002 per request.
Integration use cases
Number-line rendering in an app
Consume the structured intervals directly to draw the solution set, with open and closed endpoints already decided for you.
Technical questions
Why is a = 0 rejected?
Because with a = 0 the unknown x disappears from the inequality. The problem is then a constant comparison with no interval to return, so it is reported as invalid input instead of producing a misleading answer.
How are open and closed endpoints shown?
Each interval carries lower_open and upper_open booleans. Strict operators produce open ends, non-strict operators produce closed ends, and unbounded ray ends are omitted from the object.