Skip to content
Saha Hesap
TR TürkçeEN English (selected)

Absolute Value and Piecewise Function Calculator

Solves absolute value equations and inequalities step by step, evaluates expressions, writes them piecewise and evaluates piecewise functions.

What does this tool do?

It has three tabs. The equation and inequality tab solves an equation or inequality that contains absolute values and shows the solution set on a number line. The value tab evaluates an absolute value expression at a given x step by step and rewrites it as a piecewise function. The piecewise tab evaluates a function made of up to four pieces at a given point.

What is an absolute value?

The absolute value of a number is its distance from zero on the number line, so it is never negative: |5| = 5 and |−5| = 5. If the inside is not negative it is left as it is, and if it is negative its sign is changed. Type the bars with the | key or write abs(x).

Rules for equations and inequalities

Let k be a positive number.

  • |u| = k means u = k or u = −k
  • |u| < k means −k < u < k
  • |u| > k means u < −k or u > k

If k is negative, |u| = k and |u| < k have no solution, while |u| > k is true for every number.

Example

Type |2x - 3| = 5. The inside can be 5 or −5. From 2x − 3 = 5 we get x = 4 and from 2x − 3 = −5 we get x = −1. The solution set is {−1, 4}. An inequality: |x + 1| < 4 means −4 < x + 1 < 4, and subtracting 1 everywhere leaves −5 < x < 3.

Several absolute values

For expressions such as |x - 1| + |x + 2| = 5 the tool finds the critical points, the values of x where the inside of an absolute value is zero (here −2 and 1). They split the number line into intervals. In each interval the sign of every absolute value is known, so the expression becomes a linear equation that can be solved. A solution is kept only if it lies inside that interval. Equations with x on the right side, such as |x - 1| = 2x + 3, are solved the same way.

Piecewise functions

For each piece type an expression and a condition, such as x < 0, 0 <= x < 2 or x >= 2. The last piece may have the condition "otherwise". The tool shows which condition your x satisfies and evaluates that piece. It also gives the domain of the function and the values from the left and from the right where two pieces meet: if they are equal the function is continuous there, otherwise it jumps.

Limits

The equation and inequality tab only handles absolute values of linear expressions: equations such as |x² − 1| = 3 and nested absolute values are not supported. Coefficients must be whole numbers, fractions or decimals. In a piecewise function the conditions use a single variable and number bounds. The continuity check at the end points compares the values of the neighbouring pieces at that point.

Related calculators

Found a mistake or something missing?

If a value looks wrong, a size is missing or you need a feature, write to us and we will fix it.

Send an email