Associated Topics || Dr. Math Home || Search Dr. Math

### Piecewise Notation and Absolute Value

```
Date: 9/9/96 at 13:25:22
From: Anonymous
Subject: Piecewise Notation and Absolute Value

Using piecewise notation, write x in terms of y for the following
equation:  "y = 2x + abs(2-x)".  I have graphed the equation and I
think part of the answer is x = y-2 for y in the range of negative
infinity to 4. Is there another way to do this rather than graphing?
Please describe the method.
```

```
Date: 02/04/97 at 22:27:01
From: Doctor Sam
Subject: Re: Piecewise Notation and Absolute Value

If you already graphed y = 2x + abs(2-x) then you know that it looks
like parts of two lines.  Those parts are the "pieces" in "piecewise
notation." The reason that there are two pieces is that the absolute
value function is also in pieces:

x when x is positive or zero
abs (x) =
-x when x is negative

To change your absolute value equation into piecewise form ask
yourself, "When is 2-x positive or zero?  When is it negative?"

Since 2-x = 0 when x = 2, this point marks the x-value of the part of
the function when the graph changes from one piece to the next.
When x < 2 the expression inside abs(...) is a positive number so
abs(2 - x) = 2 - x.

On the other hand, when x > 2 the expression inside abs( ) is a
negative number and so its absolute value is the opposite.
That is, abs(2 - x) = - (2 - x) = x - 2 for x-values in this
range.

To finish the problem, figure out what y is in each part of
the graph:

/  2x + (2 - x)    when x < 2   \
y =  |                                |
\  2x + (x - 2)    when x >=2   /

Finally, simplify these two expressions to get that y = x + 2
when x < 2 and y = 3x-2 when x >=2.

I hope that helps!

Write back if you need more help.

--Doctors Sam and Sydney, The Math Forum

```

```
Date: 09/08/2010 at 11:49:04
From: Renee
Subject: Piecewise Notation and Absolute Value - explanation on forum

Hello,

I'm writing to you for clarification on this problem.

I found the explanation about absolute values very helpful; yet the one
thing I can't figure out is how/when you know to make the plain "greater
than" versus the "greater than or equal to" for the final part of the
piecewise function:

why did the 'equal to'
/ 2x + (x - 2)   when x >= 2   <---- appear in this section ...
y =  |
\ 2x + (2 - x)   when x < 2    <---- rather than in this one?

I have tried looking up the answer but cannot find an explanation to the
specific problem that you have already demonstrated. I was thinking that
maybe the 'positive' section would have the equality because you included
the question "When is 2 - x positive or zero?" However, in the end, you
concluded only the strict inequality x < 2.

Thank you so much!

```

```
Date: 09/08/2010 at 14:02:16
From: Doctor Peterson
Subject: Re: Piecewise Notation and Absolute Value - explanation on forum

Hi, Renee.

Where you put the "or equal" is actually arbitrary in this kind of
problem; it makes no difference whether you say

/  2x + (2 - x)    when x < 2
y =  |
\  2x + (x - 2)    when x >= 2

or

/  2x + (2 - x)    when x <= 2
y =  |
\  2x + (x - 2)    when x > 2

This is because for x = 2, both ...

2x + (2 - x)

and

2x + (x - 2)

... have the same value -- namely, 4.

In particular, note that |0| = 0, which is equal to both x and -x; the two
"pieces" meet, so that one point lies on both "pieces," and can be
considered a part of either one. More generally, when a piecewise function
is continuous, it doesn't matter which "piece" we put the junctions with.

So technically, Doctors Sam and Sydney made a mistake in implicitly
answering the question "When is 2 - x positive or zero? When is it negative?"

x < 2; x >= 2,

... it should have been as you suggest:

x <= 2; x > 2

I suspect they wrote what they did out of habit: when it doesn't matter, we
tend to include 0 with the positives rather than the negatives, and they
included 2 with the numbers greater than 2. Ideally, they would have been
more careful -- or just explained why, in the end, it made no difference.

- Doctor Peterson, The Math Forum
http://mathforum.org/dr.math/

```

```
Date: 09/08/2010 at 16:45:45
From: Renee
Subject: Thank you (Piecewise Notation and Absolute Value - explanation on forum)

Thank you thank you thank you so much!!! Very very helpful and cleared
things up a lot :)

you da best!
:D
Renee
```
Associated Topics:
High School Equations, Graphs, Translations

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search