# How to express 2 absolute values as a piecewise function??

I understand how to solve 1 absolute value as a piecewise function. $f(x)=|x-1|$ $$f(x)= \begin{cases} x-1& \text{if }x\ge1\\ 1-x&\text{if }x<1 \end{cases}$$

But when a function involving 2 absolute values (or maybe more), I get stuck.

What are the steps to take in order to solve function like this? $f(x)=|x-1|-|x+3|$

Note that the "changes" happen only at the points 1 and -3. If $x<-3$ then $|x+3|=3-x$ and $|x-1|=1-x$ (by definition of ||). Can you complete the problem now by considering what happens when $-3 \leq x \leq 1$ and $x > 1$?
• You are right. I already considered x=1 in the case $-3 \leq x \leq 1$ – voldemort Jan 16 '14 at 1:43
• They are the same at point $1$ @Joshua – gaoxinge Jan 16 '14 at 1:52
• It's like the definition of $|x - 1|,$ which has a case for $x \ge 1$ and another case for $x < 1.$ You could just as well make one case $x > 1$ and the other case $x \le 1.$ Either way is fine, as long as every value fits in one of the cases. We usually don't let a value belong to two cases simultaneously. – David K Sep 10 '14 at 2:01