# How could we solve $x$, in $|x+1|-|1-x|=2$?

How could we solve $x$, in $|x+1|-|1-x|=2$?

Please suggest a analytical way that I could use in other problems too like this $|x+1|+|1-x|=2$ and of this genre.

Thank you,

-
In general, it is best to split problems like this into cases to get rid of the absolute values. Solve the equation first for $x \leq -1$. Then solve it for $-1 \leq x \leq 1$. Finally treat the case $1 \leq x$. This way you find all the possible solutions. –  Mikko Korhonen Jan 11 '12 at 13:40
Answers to this question mention several methods that can be used for solving such equations. –  Martin Sleziak Jan 11 '12 at 13:53
The equation you proposed is a very special case, where the solution can be seen almost immediately from the geometrical meaning. Just notice that the LHS is the difference between the distance of the point $x$ from the point $1$ and the distance of the point $x$ from the point $-1$. –  Martin Sleziak Jan 11 '12 at 15:19
You can write the equation $|x+1| - |x-1| = |(x+1)-(x-1)|$. –  Joel Cohen Nov 14 '12 at 11:33

The most efficient method is to split problems like this into cases. We do this to get rid of absolute value signs, which reduces the problem to solving simple linear equations.

Notice that $x+1$ changes its sign only at $x = -1$ and similarly $1-x$ changes its sign only at $x = 1$. Splitting the real line at these two points gives us three intervals, and in each of these intervals we can express $|x+1| - |1-x| = 2$ as a linear equation. This is because the signs of $x+1$ and $1-x$ will not change when operating inside one interval, as they are both continuous functions.

So we will consider three cases: $x \leq -1$, $-1 \leq x \leq 1$ and $1 \leq x$. This will give us all the solutions, since any real number belongs to one of the three cases.

When $x \leq -1$, then $|x+1| = -x-1$ and $|1-x| = 1-x$, so the equation becomes $-x-1 - (1-x) = 2 \Leftrightarrow -2 = 2$. This is not possible, so there are no solutions when $x \leq -1$.

Similarly, when $-1 \leq x \leq 1$, then $|x+1| = x+1$ and $|1-x| = 1-x$. Then the equation becomes $x+1 - (1-x) = 2 \Leftrightarrow x = 1$. Thus $x = 1$ is the only solution when $-1 \leq x \leq 1$.

Finally, in the case of $x \geq 1$, then $|x+1| = x+1$ and $|1-x| = -1+x = x-1$. The equation becomes $x+1 - (x-1) = 2 \Leftrightarrow2=2$. Since $2=2$ is always true, any $x \geq 1$ is a solution.

Thus the set of solutions is $[1, \infty]$.

This method also works in general, when we have to solve an equation with continuous functions inside absolute value signs. We find the “splitting points” for different cases by finding the roots of these functions. Then in each interval we need to find the sign of each function inside an absolute value sign. This becomes more difficult when dealing with functions like $\sin$, but is simple enough when each function is a straight line such as $x+1$ and $1-x$.

-

This is the same solution as m.k. wrote; I am just mentioning the useful and clear way how to write it down.

I was taught to always make a table like this, dividing the real line by the points where the expression for absolute value changes. $$\begin{array}{|c|c|c|c|c|c|} x\in & (-\infty,-1\rangle && \langle-1,1\rangle && \langle1,\infty) \\\hline |x+1| & -1-x &|& x+1 && x+1 \\\hline |1-x| & 1-x && 1-x &|& x-1 \\\hline \end{array}$$

If you think that it is helpful for you, you can also mark in the table where the expression for each of the absolute values changes as I did above. (This is what that additional columns are about. I did not know how to plot it nicer in LaTeX markup.)

Without those marks the table looks like this: $$\begin{array}{|c|c|c|c|} x\in & (-\infty,-1\rangle & \langle-1,1\rangle & \langle1,\infty) \\\hline |x+1| & -1-x & x+1 & x+1 \\\hline |1-x| & 1-x & 1-x & x-1 \\\hline \end{array}$$

I make sure that I did not make a mistake in that table and then I solve the equation $|x+1|-|1-x|=2$ in each interval separately.

For example, for $x\in\langle1,\infty)$, I look up in the table that this equation can be rewritten like this: \begin{align} |x+1|-|1-x|&=2\\ (x+1)-(x-1)&=2\\ 2&=2 \end{align}

So every real number is a solution of this, but since the original equation is equivalent to the last one only for $x\in\langle1,\infty)$, so far I only know that solutions $\mathbb R\cap\langle1,\infty)=\langle1,\infty)$ is one part of the solution set. I have to look for the solutions in remaining two intervals, as well.

And for $x\in\langle-1,1\rangle$ I get $2x=2$, which has $x=1$ as the only solution. Note that I already counted this solution in the preceding case.

For $x\in(-\infty,-1\rangle$ I get no solutions, since the equation is now $-2=2$.

Now I just put together the three solution sets: $\emptyset\cup\{1\}\cup\langle1,\infty)=\underline{\underline{\langle1,\infty)}}$.

The same principle works in general – divide the problem into cases, solve for each case and take only those solutions which lie in that interval, then take the union of all those solutions.

In my opinion, a useful thing to do is to sketch a graph of your function too – quite often this is not so difficult. Have a look at this WolframAlpha plot of $|x+1|$ and $|1-x|$ and this plot of $|x+1| - |1-x|$ and $2$.

There is also a geometric interpretation of $|x+1|=|x-(-1)|$ is distance from $x$ to $-1$. Similarly $|x-1|$ is simply distance from $1$.

So solving $$|x+1|-|x-1|=2$$ simply means looking for points such that the distance from $-1$ is greater than the distance from $1$ by $2$.

We can see that $x=1$ has this property and so do all the points to the right from $1$. But if we move to the left from $1$, then this difference decreases.

So the set of all solutions is the interval $[1,\infty)$.

The geometric approach is also explained here.

NOTE: I made this a CW on purpose. If someone feels they can add something useful to this explanation or improve the post in any way, please, do it.

-

Here is one approach using the definition $|x|=\sqrt{x^2}$.
Rewrite your equation as $$|x+1|=2+|1-x|$$ and apply the above definition.
i.e. we would have $$\sqrt{(x+1)^2}=2+\sqrt{(1-x)^2}.$$ The next step is to square both sides to get rid or the square roots.

i.e $$\left( \sqrt{(x+1)^2}\right)^2 = \left(2+\sqrt{(1-x)^2}\right)^2.$$I believe you can take it from here.

Hope this helps.

-
That won't help since you'll end up with the equation $0 = 0$. –  Bill Dubuque Jun 4 '12 at 20:47
I can confirm Bill Dubuque’s comment. I continued working through this approach and ended up with $0=0$. –  Rory O'Kane Nov 14 '12 at 11:12
It won't end up with $0=0$ if you don't square any more. Instead you will get $x-1 = \sqrt{(x-1)^2} = |x-1|$ and so $x-1$ is non-negative and hence $x \ge 1$. However, this approach is still to be avoided at all costs because it is difficult to manipulate expressions involving square roots and preserve the solution set. In this case the first squaring "by chance" didn't change the solution set, but not in general. So the whole method is still useless even though it got the right answer in this case. –  user21820 Apr 23 '14 at 12:24

Hint:

One characterization of "$x$ is between $a$ and $b$" is $$|x-a|+|x-b|=|a-b|$$

-

Case 1: $x\ge1$, then $$|x+1|=x+1,|1-x|=x-1.$$ The equation becomes $x+1-(x-1)=2$, which is true. So $x\ge1$ satisfies the equation.

Case 2: $-1<x<1$, then $$|x+1|=x+1,|1-x|=1-x.$$ We have $$(x+1)-(1-x)=2x<2,$$ so $-1<x<1$ does not satisfy the equation.

Case 3: $x\le 1$, then $$|x+1|=-(x+1), |1-x|=1-x.$$ We have $$-(x+1)-(1-x)=-2<2,$$ so $x\le -1$ does not satisfy the equation.

Answer: $x\ge 1$.

-

(This isn’t really an answer, but it’s too big for a comment. It’s just continuing from where Nana stopped in their answer, revealing that you can’t find the solution using that approach.)

We have just squared both sides to try to get rid of the square roots.

$$\left( \sqrt{(x+1)^2} \right)^2 = \left( 2 + \sqrt{(1-x)^2} \right)^2$$

Continuing from here:

Cancel on the left, expand the square on the right. $$(x+1)^2 = 4 + 4 \sqrt{(1-x)^2} + (1-x)^2$$ Expand squares. $$x^2 + 2x + 1 = 4 + 4 \sqrt{(1-x)^2} + 1 - 2x + x^2$$ Combine terms. $$4x - 4 = 4 \sqrt{(1-x)^2}$$ Divide by coefficient. $$x - 1 = \sqrt{(1-x)^2}$$ Square both sides again to get rid of that last square root. $$(x - 1)^2 = \left(\sqrt{(1-x)^2}\right)^2$$ Cancel on the right. $$(x - 1)^2 = (1-x)^2$$ Expand squares. $$x^2 - 2x + 1 = 1 - 2x + x^2$$ Rearrange terms. $$x^2 - 2x + 1 = x^2 - 2x + 1$$ Combine terms. $$0 = 0$$

The equation $0=0$ doesn’t help us find the correct values of $x$. To solve the problem, we must use another approach.

-