How to simplify absolute value expressions such as: $|x+1|+|x-1|$ algebraically?

397 Views Asked by At

After plotting this function on desmos, I understood that this absolute expression is actually a piecewise function.
Hence this: $$f(x)=|x+1|+|x-1|$$is the same as $$f(x)=\left\{\begin{align}2x\quad&\text{if }x>1\\-2x\quad &\text{if }x<-1\\2\quad &\text{if}-1<x<1\end{align}\right.$$

But is there a way to do this algebraically instead of plotting?

4

There are 4 best solutions below

0
On BEST ANSWER

The way to see this is as follows: you must observe that $$|f(x)| = \begin{cases} f(x), & f(x) \geq 0 \\ -f(x), & f(x) < 0\text{.} \end{cases}$$ It does not matter where the equality sign goes (i.e., $\geq$ as opposed to $>$, or $<$ as opposed to $\leq$) in the vast majority of situations.

We thus have $$|x + 1| = \begin{cases} x + 1, & x + 1 \geq 0 \\ -(x+1), & x + 1 < 0 \end{cases} = \begin{cases} x + 1, & x \geq -1 \\ -x - 1, & x < -1 \end{cases}$$ $$|x - 1| = \begin{cases} x - 1, & x - 1 \geq 0 \\ -(x - 1), & x - 1 < 0 \end{cases} = \begin{cases} x - 1, & x \geq 1 \\ -x + 1, & x <1\text{.} \end{cases}$$ Next, we must add these functions together.

First, observe that $|x + 1|$ is defined piecewise over the intervals $(-\infty, -1)$ and then $[-1, \infty)$. These are indicated by the blue and red below respectively.

For $|x - 1|$, we must look at $(-\infty, 1)$ and then $[1, \infty)$. These are indicated by the orange and green below respectively.

Apologies for my art skills.

enter image description here

Given the above, it is clear that the sum of $|x + 1|$ and $|x- 1|$, as a piecewise function, must have three components:

  • The blue-orange one, in $(-\infty, -1)$
  • The red-orange one, in $[-1, 1)$
  • The red-green one, in $[1, \infty)$.

The blue-orange component is when $x < -1$, or $|x + 1| = -x - 1$ and $|x - 1| = -x + 1$. Thus the sum of these is $-x - 1 + (-x + 1) = -2x$.

The red-orange component is when $-1 \leq x < 1$, or $|x + 1| = x + 1$ and $|x - 1| = -x + 1$. Thus the sum of these is $x + 1 + (-x + 1) = 2$.

The red-green component is when $x \geq 1$, or $|x + 1| = x + 1$ and $|x - 1| = x - 1$. Thus the sum of these is $x + 1 + (x - 1) = 2x$.

3
On

\begin{align}\lvert x+1\rvert+\lvert x-1\rvert&=\begin{cases}x+1+\lvert x-1\rvert&\text{if }x\ge-1\\ -x-1+\lvert x-1\rvert&\text{if }x<-1\end{cases}=\\&=\begin{cases}x+1+ x-1&\text{if }x\ge-1\land x\ge1\\x+1- x+1&\text{if }x\ge-1\land x<1\\ -x-1+ x-1&\text{if }x<-1\land x\ge1\\ -x-1- x+1&\text{if }x<-1\land x<1\end{cases}=\\&=\begin{cases}2x&\text{if } x\ge1\\2&\text{if }-1\le x<1\\ -2x&\text{if }x<-1\end{cases}\end{align}

0
On

We know $f(x) \geq 0$.

And, $$ \begin{align} \{f(x)\}^2 & = (x+1)^2 + (x-1)^2 + 2 \lvert x + 1 \rvert \cdot \lvert x - 1 \rvert \\ & = 2(x^2 + 1) + 2 \lvert x^2 - 1 \rvert \\ & = \begin{cases} 2(x^2 + 1) + 2(x^2 - 1) = 4x^2 ~~~~~ \text{if } x^2 \geq 1, \\ 2(x^2 + 1) - 2(x^2 -1) = 4 ~~~~~ \text{if } x^2 \leq 1. \end{cases} \end{align} $$

Because $f(x) \geq 0$, hence,

$$ f(x) = \begin{cases} 2|x| ~~~~~ \text{if } |x| \geq 1, \\ 2 ~~~~~ \text{if } |x| \leq 1. \end{cases} $$

0
On

Plotting can give hints on what to do, but they're not conclusive.

The especially interesting points for $|f(x)|$ are those where $f$ “changes sign". In your case you have two of them, namely $-1$ and $1$.

So you can start to see what happens when $x<-1$: here we have $x+1<0$ and also $x-1<0$, so $$ f(x)=-(x+1)-(x-1)=-2x $$ When $-1\le x\le 1$, we have $x+1\ge0$ and $x-1\le 0$, so $$ f(x)=(x+1)-(x-1)=2 $$ When $x>1$, we have $x+1>0$ and $x-1>0$, so $$ f(x)=(x+1)+(x-1)=2x $$ Conclusion: $$ f(x)=\begin{cases} -2x & x<-1 \\[6px] 2 & -1\le x\le 1 \\[6px] 2x & x>1 \end{cases} $$ Where to put the special points? Don't worry, it's irrelevant. You could as well divide the cases into $$ x\le -1 \qquad -1<x<1 \qquad x\ge 1 $$ and the function wouldn't change, of course.