Absolute Value Equation Calculator & Distance Levels
Enter anchor positions and signed weights, then set a target. The workspace derives every linear branch, solves for all equalities and shows the exact closed solution set. Inspect a branch or test a specific x while comparing the results on the graph.
Solve an absolute-value equation by distance
Combine weighted distances, then find the exact points and intervals where the sum meets a target.
Distance terms and target
Enter one anchor and weight per line. The row 2, 3 represents 3 × |x − 2|. Negative weights subtract a distance.
The target has 2 isolated solutions.
Exact solution set
{-1} ∪ {1}
- F(x) at inspected x
- 4
- Target check
- Does not match
Inspect an automatically derived branch
- Branch domain
- [-2, 0]
- Slope
- 2
- Intercept
- 4
- Solutions in this branch
- {-1}
Export the equation worksheet
Save the exact inputs, slopes, intercepts and solution bounds.
View CSV text
How to use this calculator
- Enter one anchor and one weight per line. A single positive row gives a standard absolute-value distance equation.
- Set the target level. Negative weights model subtraction of a distance.
- Read the exact set and select a branch to inspect its domain, slope and matching values.
- Enter a test x or export the worksheet for exact input, branch and solution rows.
The Formula
The mathematical logic powering this calculation is:
Each row with anchor a and weight w contributes w|x−a|. Combine weights at equal anchors so canceled terms create no breakpoint. With F(x) the sum, solve F(x)=T for the entered target.
To the left of all active anchors, each term is w(a−x). The first branch therefore has slope m = −Σw and intercept b = Σwa. At anchor a with total weight w, the slope increases by 2w and the intercept decreases by 2wa. The branches meet at their shared endpoint.
Within a branch, if m is nonzero, the candidate is x=(T−b)/m. Keep it only when it is in the branch’s closed domain. A zero-slope branch matches across its entire domain when b=T. Combine touching candidates so an endpoint is counted once, and show rays if the match continues without bound. Evaluating a test value uses the original weighted distance rule.
Enter one to six rows. Anchors, weights, target and optional test x support signed decimals through magnitude 1 billion and up to 12 fractional places. Weight zero contributes nothing. Inputs, solutions and comparisons stay exact as fractions. The visible graph window is finite and approximate; the exact solution set includes any unbounded region.Worked Example
If you input:
- Terms: |x+2| − 2|x| + |x−2|
- Target: 2
Result:
The target is reached at x=−1 and x=1. Both tails have value zero. The graph peaks at 4 when x=0.
Frequently Asked Questions
How do I solve a simple equation such as |x−3|=5?
Enter anchor 3, weight 1 and target 5. The solutions are −2 and 8.
Why does a whole interval sometimes solve the equation?
On a flat branch the weighted distances balance. If that branch’s value equals the target, every point in the branch is a solution.
Can the target be negative?
Yes. Negative weights subtract distance, so the weighted sum can reach a negative value.
Does the graph show an unbounded solution?
A ray uses an arrow at the edge of the chart and an infinite endpoint in the exact solution set.
Similar Calculators
Inequality Calculator
Solve linear, quadratic and absolute-value inequalities in one real variable. Combine conditions, inspect exact intervals and graph the solution on a number line.
Piecewise Function Graph Calculator
Graph a piecewise function with open and closed endpoints. Evaluate f(x), compare one-sided limits, and identify gaps, jumps and removable discontinuities.
Slope & Line Equation Calculator
Find slope, intercepts and exact line equations from two points or known coefficients. Graph parallel and perpendicular lines and find the shortest distance from a point.
