Algebra · real student question

Solve the equation |x| + |x - 1| = 3.

Question

Solve

x+x1=3|x|+|x-1|=3

Step-by-step solution

  1. Locate the breakpoints. Each absolute value changes formula where its inside is zero: x=0x=0 for x|x| and x=1x=1 for x1|x-1|. These two points cut the real line into x<0x<0, 0x<10\le x<1 and x1x\ge 1. Inside each piece both absolute values can be replaced by plain linear expressions, which is the whole point of the split.

  2. Case 1: x<0x<0. Both insides are negative, so x=x|x|=-x and x1=1x|x-1|=1-x:

    x+(1x)=3  2x+1=3  x=1-x+(1-x)=3\ \Longrightarrow\ -2x+1=3\ \Longrightarrow\ x=-1

    Now test the case condition: 1<0-1<0 ✓, so x=1x=-1 is a genuine solution.

  3. Case 2: 0x<10\le x<1. Here x=x|x|=x but x1=1x|x-1|=1-x:

    x+(1x)=3  1=3x+(1-x)=3\ \Longrightarrow\ 1=3

    The xx terms cancel and the statement is false, so this interval contributes nothing. Geometrically, x+x1|x|+|x-1| is the total distance from xx to 00 and to 11, which equals exactly 11 everywhere between them — it can never reach 33.

  4. Case 3: x1x\ge 1. Both insides are non-negative, so x=x|x|=x and x1=x1|x-1|=x-1:

    x+(x1)=3  2x=4  x=2x+(x-1)=3\ \Longrightarrow\ 2x=4\ \Longrightarrow\ x=2

    Check the condition: 212\ge 1 ✓, so x=2x=2 is valid.

  5. Always test candidates against their own case. Discarding a value that solves the equation of one case but lies in another interval is the standard error here. Both surviving values pass, and substituting back confirms them: 1+2=1+2=3|-1|+|-2|=1+2=3 ✓ and 2+1=2+1=3|2|+|1|=2+1=3 ✓.

  6. State the solution set. x=1x=-1 or x=2x=2. The distance interpretation explains why there are exactly two: you need total distance 33 from the pair {0,1}\{0,1\}, and that happens at one point on each side of the segment.

Answer

x=1orx=2x=-1\quad\text{or}\quad x=2

Need to solve a different problem like this? Open the solver →