Maths & numbers

Absolute value equation calculator

Solve an absolute value equation by splitting it into two linear equations.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

If the distance is zero, the two linear equations coincide and produce one root when the slope is nonzero.

THE FORMULA|ax+b| = c gives ax+b = ±c

A worked example

|2x−3| = 5 has roots −1 and 4.

Good to know

A zero slope makes the equation constant.

Split the distance equation into two branches

For |2x − 3| = 5, the expression inside the bars can equal either 5 or −5. Solving 2x − 3 = 5 gives x = 4. Solving 2x − 3 = −5 gives x = −1. Substitution confirms both roots because their inside values have the same absolute value.

The graph of y = |2x − 3| is V-shaped with its lowest point at x = 1.5. The horizontal line y = 5 crosses the two arms at −1 and 4. This picture explains why a positive distance generally gives two roots when the coefficient of x is nonzero.

The line y equals five intersects the absolute-value V at minus one and foury = |2x − 3|y = 5-141.5
Worked example |2x − 3| = 5. Both crossing points lie on the horizontal target line.

Check the zero-distance and zero-slope cases

When the requested distance is zero, the branches coincide. The equation |2x − 3| = 0 has the single root 1.5. The field requires a nonnegative distance because the absolute value of a real expression is nonnegative.

If the slope is zero, the left side becomes the constant |b|. Every real x then works when |b| equals the requested distance, and no x works otherwise. The Absolute value calculator helps inspect this constant. For a nonzero slope, the general roots are (c − b)/a and (−c − b)/a. Their numerical ordering can reverse when a is negative, so the calculator sorts the results before assigning lower and upper labels.

A few questions, answered

Why are there sometimes two roots?

Both a positive and a negative inside value can have the requested magnitude. Each linear branch can therefore produce a root.

Can I verify the roots by squaring?

Squaring both sides is valid here when the requested distance is nonnegative. Substitution into the original absolute-value equation still gives the most direct check.

Find your calculator

Start typing to explore the library.