# How to solve this absolute value equation?

Consider the absolute value equation:

|x| + |x-2| +|x-4|= 6

How to find the solution(s)?

My attempt:

For |x|, we got x, for x>=0 and -x, for x <0

For |x-2|, we got x-2, for x >= 0 and -(x-2), for x<0

For |x-4|, we got x-4, for x>=0 and -(x-4), for x<0

After this, I'm confused how to find the solutions? is it any easy way to find the solution?

Thanks

• you have to do case work – Dr. Sonnhard Graubner Sep 29 '14 at 18:16
• $x\geq 4$, $2\le x<4$, $0\le x<2$, $x<0$ – Dr. Sonnhard Graubner Sep 29 '14 at 18:17
• And accordingly, you get: $x={4,4,0,0}$, which gives, $x={4,0}$ – Sudeepan Datta Sep 29 '14 at 18:20

I think you misunderstand the absolute value.

Note that $$|x|=\begin{cases}x &\text{if x\ge 0}\\-x &\text{if x\lt 0}\end{cases}$$ So, for example, $$|x-2|=\begin{cases}x-2 & \text{if \color{red}{x-2}\ge 0}\\-(x-2)& \text{if \color{red}{x-2}\lt 0}\end{cases}$$

So, for your question, separate it into four cases as

(1) $x\lt 0$.

(2) $0\le x\lt 2$.

(3) $2\le x\lt 4$.

(4) $x\ge 4$.

You have 3 "nodes" for switching $|x|$ , $|x-2|$ and $x-4|$. The easiest way is to imagine real line with these points and split solution considering intervals $[-\infty,0],[0,2],[2,4],[4,\infty]$ separately. On each interval you can remove $||$ with certain sign and immediately solve the equation, checking that final solution is in the corresponding interval.

• $x<0$ leads to $6-3x=6$

Solve this equation and check wether the solution satisfies $x<0$. If so then you have found a solution of the original equation. If not then no solution exists that satisfies $x<0$.

Do the same for the cases:

• $0\leq x<2$

• $2\leq x<4$

• $4\leq x$

Define $n = x - 2$, and rewrite the equation.

$$|n-2| + |n| + |n+2| = 6$$

In this form we can easily see that if $n$ is a solution, so is $-n$. Thus WLOG we will assume that $n$ is positive. We can then remove some redundant $|\cdot|$s.

$$|n-2| + (n) + (n + 2) = 6 \implies |n-2| + 2n = 4$$

Clearly then, because $|n-2| \geq 0$, we have $|n-2| + 2n = 4 \implies n \leq 2$. This means that $n-2 \leq 0$ and so we can remove another $|\cdot|$.

$$-(n-2) + 2n = 4 \implies n = 2$$

And thus we have two solutions, $n = \pm 2$ or $\boxed{x = 0, 4}$.

• Aren't there four solutions for the equation, -2, 0, 4 and 2? ±2 represents two solutions -2 and 2, because the symbol ± means positive OR negative, not positive AND negative. – Toby Mak Apr 16 '17 at 7:38
• @TobyMak, $x-2=n=\pm 2$, therefore $x=\pm 2 + 2=0,4$. Certainly $-2$ and $2$ are not solutions to the original equation. – Ben Frankel Apr 16 '17 at 18:02
• Sorry for my misunderstanding – Toby Mak Apr 16 '17 at 23:39

Think of the modulus function measuring the distance from fixed points. So that $|x|=|x-0|$ is the distance from $0$.

So your sum measures the total distance from the points $0,2,4$

If $x$ is greater than $4$ the first two distances are greater than $4$ and $2$

If $x$ is less than $0$ we reach the same conclusion with the last two points by symmetry.

If $x$ is between $0$ and $2$ the total distance to $0$ and $2$ is always $2$, and the remaining distance is less than $4$. Similarly by symmetry for the points between $2$ and $4$.

Now check the points $0$, $2$, $4$ themselves