# Absolute values

1. Sep 4, 2008

### BoundByAxioms

How could I go about expressing |x|-|x-6| without using absolute value signs?

2. Sep 4, 2008

### snipez90

I would just look at when the expression inside each absolute value is negative or positive. For instance, if x is negative, then you easily get x - (x+6) = -6 so if x is any negative value, you'll get the constant function f(x) = -6.

You'll ultimately express it as a piecewise function but there shouldn't be many "pieces".

3. Sep 5, 2008

### CRGreathouse

Here are two thoughts, entirely unsimplified (so you have something to do!).

1. |x| - |x - 6| =
(x) - (x - 6), x >= 0 and x - 6 >= 0
(x) - -(x - 6), x >= 0 and x - 6 < 0
-(x) - (x - 6), x < 0 and x - 6 >= 0
-(x) - -(x - 6), x < 0 and x - 6 < 0

2. sqrt(x^2) - sqrt((x - 6)^2)

Note that both assume that x is real.

4. Sep 5, 2008

### HallsofIvy

Staff Emeritus
If x< 0, both x and x-6 are negative so |x|- |x-6|= -x-(-(x-6)= -x+ x- 6= -6.

If $0\le x< 6$, x- 6 is negative so |x|- |x-6|= x- (-(x-6))= x+x- 6= 2x- 6
If $6\le x$, both x and x- 6 are positive so |x|- |x-6|= x- (x-6)= 6.

We can write
$$|x|-|x-6|= \left\{\begin{array}{cc}-6 & if x< 0\\2x-6 & if 0\le x< 6\\6 & if x>6\end{array}\right$$

We could also use the Heaviside step function. H(x), which is 0 for x< 0 and 1 for $x\ge 0$. We want to start with -6 for x<0 and for x> 0 we have to add 2x: -6+ 2xH(x).
Now, if x is greater than 6, we need to change that -6 to 6 and eleminate the 2x. We can do that by adding 12- 2x.

|x|- |x-6|= -6+ 2xH(x)+ (12- 2x)H(x- 6).

5. Sep 5, 2008

### BoundByAxioms

Thanks to all who responded, your help is appreciated!