Piecewise Defined Functions
Piecewise Defined Functions
Most of the functions that we’ve looked at this semester can be expressed
p
as a single equation. For example, f (x) = 3x2 5x + 2, or g(x) = x 1,
or h(x) = e3x 1.
Sometimes an equation can’t be described by a single equation, and instead
we have to describe it using a combination of equations. Such functions are
called piecewise defined functions, and probably the easiest way to describe
them is to look at a couple of examples.
9~;
~! I
e
To To
To graph
graph
Tograph g(x),
g(x),
graphg(x), graph
graph
g(x),graph each
each of
eachofof
grapheach the
the
ofthe pieces
pieces
piecesofof
thepieces ofg.g.
of g.That
g. Thatis,is,
That
That is,graph
is, graphgggg: :(:: ((( 1,
graph
graph ⇤,0]0]
⇤,
⇤, 0]!
0] ⇥RR
⇥
⇥ R
R
where
where
whereg(x)
where g(x)
g(x) =
=xxx
g(x)== x
2
1,1,
2 22 1, and
and
1,and graph
graphgggg: :[0,
graph
andgraph :: [0,
[0, 4]!
[0,4]4]
4] ⇥RR
⇥
⇥ Rwhere
R whereg(x)
where
where g(x)==
g(x)
g(x) =xxx
= x 1,1, 1,and
1, andgraph
and
and graph
graph
graph
gggg: :::[4,
[4,
[4, ⇤)
⇤)
⇤)!
[4,1) ⇥⇥
⇥RR R where
Rwhere
where g(x)
g(x)
g(x)==
whereg(x) = 3.
=3.3. Together,
Together,
3. Together,
Together,these these1three
these
these threepieces
three
three piecesmake
pieces
pieces makeup
make
make upthe
up
up the
the
the
graph
graph
graphofof
graph of g(x).
g(x).
ofg(x).
g(x).
Graph
Graph of
Graphofof
Graph ⇤,
ofgggg: :(:: ((( 1,
⇤, 0]
⇤,0]0]
0]!⇥
⇥ Rwhere
⇥RR
R whereg(x)
where
where g(x)
g(x)
4, ==
g(x) = x222 1.1.
=xx2x 1.
1.
5
Graph
Graph of
ofgggg: :[0,
Graphofof
Graph :: [0,
[0, 4]
[0,4]4]
4]!⇥
⇥ Rwhere
⇥RR
R whereg(x)
where
where g(x)==
g(x)
g(x) =xxx
= x 1.1.
1.
1.
a a C
—I
Graphofof
Graph
Graph ofggg: :[4,
: [4, ⇤)!
[4,1)
⇤) ⇥⇥RR
Rwhere
where g(x)
g(x)==
whereg(x) =3.3.
3.
S
S
2
I
—z ‘I a r 4 .% Ii
—I
178
178
178
229
I—
To
To graph
Tograph g(x),
graphg(x), draw the
draw4,the
g(x),draw z of
£graphs
thegraphs
graphsofofall
all three
allthree ofofits
threeof its pieces.
itspieces.
pieces.
—z -i I 2 3 ‘t 5~
—I
Second
Second example.
Secondexample.
example.The The function
Thefunction :RR!
functionfff:: R ⇥⇥RRRisisisdefined
defined
definedby by
by
(
(x 22 2+ 2
3)3) ⇤=⇤=3;
f (x) = (x(x 3) ++2 2 ifififxxx6= 3;3;
f (x)
f (x)== 4
44 ifififxxx===3.
3.3.
This
This function
functionisisismade
Thisfunction made
madeup up ofoftwo
upof two pieces.
twopieces. Either
pieces. EitherEitherxxx6= ⇤=⇤=3,
3,3,in
ininwhich
which case
whichcase
case
2
f (x)
f (x) = (x 3)2 2+ 2. Or x = 3, and then f (3) = 4.
f (x)==(x(x 3)3)++2.2.Or Orx x==3,3,and
andthen
thenf (3)
f (3)==4.4.
Graph
Graph ofofthe
Graphof the first
thefirst piece
firstpiece ofofff(x):
pieceof f(x): the
(x):the graph
thegraph ofofxx2x2 2shifted
graphof shifted right
right333and
shiftedright and up
andupup222
with the point of thewith withthe
graph vertex
whose
the removed.
x-coordinate
vertex removed. equals 3 removed.
(Remember
(Remember
(Rememberthat that a little
thata alittle circle
littlecircle means
circlemeans that
meansthat point
pointisisisnot
thatpoint not
notaaapoint
point ofofthe
pointof the graph.)
thegraph.)
graph.)
It
(x-3~2+ 2
‘S
0’ I ~ 41
179
230
179
£
E
Graph of Graph of the
the second second
piece pieceaofsingle
of f (x): f (x):giant
a single giant dot.
dot whose x-coordinate
equals 3.
Lf. S
(3,9)
3
-p
ii 9. .5
Graph of
Graph of both
both pieces,
pieces, and
and hence
hence the
the entire
entire graph,
graph, of
of ff (x).
(x).
It
I I 4Z~
* * * * * * * * * * * * *
231
180
180
Absolute value
Absolute
Absolute value
value
The
The
The most
The most important
most important
most important piecewise
important piecewise defined
piecewise defined function
defined function in
function in calculus
in calculus isis
calculus is the
the absolute
the absolute
absolute
value
value
value function
value function
function that
function that
that isis
that defined
is defined
defined by by
by
(
xxx x ififif xxxif2⇤⇤x(((⇥1,⇥,
⇥, 0];
0];
0; 0];
|x|
|x|=
|x| =
=
|x| = x if x ⇤ [0, ⇥).
x x xifif xxif2⇤0[0, [0, ⇥).
⇥1).
x.
The domain
The domain
The
The domain of
domain of the
of the
of absolute
the absolute
the absolutevaluevalue function
functionisis
valuefunction R. The
R. The
isR. range
Therange
rangeof of the
ofthe absolute
theabsolute
absolute
value
value
value function
value function
function isis
function is the
is the set
the set
the set ofof non-negative
of non-negative
non-negative numbers. numbers.
numbers. The The number
The number
number |x| |x|
|x| isis called
is called
called
the
the
the absolute
the absolute
absolute value
absolute valuevalue of
value of x.
of x.
x.
For
For
For examples
For examples
examples of
examples of how this
of how
of how this function
this function works,
function works, notice
works, notice that
notice that |4| =
that |4|
|4| = 4,
= 4, |0| =
4, |0|
|0| = 0,0,
= 0, and
and
and
|||| 3|
3|
3| = 3.
= 3. If
3. (If xx is
If 3)
x is
is positive
3. If x or
positive
=positive 0,
0, then
then the
or positive
is the
or 0,absolute
absolute
then the value
value of
of xx is
absolute xx itself.
isvalue of xIf
itself. Ifisx
x xis
is
negative,
negative,
itself.
negative, then
then
If xthen |x|
is negative,
|x| is
|x| is the
is thethenpositive
positive number
|x| is number
the positivethat you’d
that number get
you’d getthat from
fromyou’d“erasing”
“erasing”
get from the
the
11 11
negative sign:
negative sign:
“erasing”
negative sign: ||| 10|
the negative 10|
10| = 10
10 and
=sign: and
| 10||| = 12 || 10
22
= .. |
= 122and
2
1
2| = 2.
1
Graph of
Graph of
Graph the
of the absolute
the absolute value
absolutevalue function.
valuefunction.
function.
Another
Another
Another interpretation
Another interpretation
interpretation of
interpretation of
of the
of the
the absolute
the absolute
absolute value
absolute value
value function,
value function, and
function, and
function, and the
and the one
the one
the that’s
one that’s
one that’s
that’s
most
most
most important
most important
important for
important for
for calculus,
for calculus,
calculus, is
calculus, isis that
is that
that the
that the absolute
the absolute
the value
absolute value
absolute of
value of
value a number
of aaa number
of number isis
number is the
is the
the
the
same
same as
same
same as
as its
as its
its distance
its distance
distance from
distancefrom
from0.
from 0. That
0. That
0. Thatis,
That is, the
is,the
is, distance
thedistance
the between
distancebetween
distance 0
between000and
between and 5 is
and555isis
and |5|
is|5|
|5| =
|5|== 5,
=5,5,
5,
the
the
the distance
the distance
distance between
distance between
between 0 and
between 000 and 7
and 777isis
and is |
is||| 7| 7|
7|=
7| =
=7,
= 7, and
7,and
7, the
andthe
and distance
thedistance
the between
distancebetween
distance 0
between000and
between and
and
and
0000 is
is |0|
|0|=
is |0|
is |0| =
=0.
= 0.
0.
0.
181
191
232
4
Let’s
Let’s look
look at
at the
the graph
graph of say |x
of say |x 3|.
3|. It’s
It’s the
the graph of |x|
graph of |x| shifted
shifted right
right by
by
3.
3.Let’s look at the graph of say |x 3|. It’s the graph of |x| shifted right by
3.
You
You might
might guess
guess from
from the
the graph of |x
graph of |x 3|, that |x
3|, that |x 3| 3| is
is the
the function
function that
that
You might
measures guess from the graph of |x that |xtrue.3| Similarly,
3|, that’s is the function
|x that
measures the distance between x and 3, and that’s true. Similarly, |x 6|
the distance between x and 3, and 6| is
is
measures
the thebetween
distance distancex between
and 6, |xx+and
2| 3,the
is anddistance
that’s true.
betweenSimilarly,
x and |x 2, and
6| is
the distance between x and 6, |x + 2| is the distance between x and 2, and
the distance between x and 6, |x + 2| is the distance between x and 2, and
more generally, |x
more generally, |x y|y| is
is the
the distance
distance between
between x x and
and y.y.
more generally, |x y| is the distance between x and y.
** ** ** ** ** ** ** ** ** ** ** ** **
* * * * * * * * * * * * *
233
192
182
5
Notice in the above paragraph that the precise number 5 wasn’t really
important for the problem. We could have replaced 5 with any positive
number c to obtain the following translation.
For example, writing |x| < 2 means the same thing as writing 2 < x < 2,
and |2x 3| < 13 means the same as 13 < 2x 3 < 13 .
We can use the above rule to help us solve some inequalities that involve
absolute values.
2 2
The inequality 2 > x > 3 could also be written as 3 < x < 2, or as
x 2 ( 23 , 2).
234
Problem. Solve for x if |2x 1| < 3.
H
‘0
N 2x-i
FL
(71
I
H
10
CA)
I
* * * * * * * * * * * * *
If c is a positive number, |x| > c means that the distance between x and 0
is greater than c. There are two ways that the distance between x and 0 can
be greater than c. Either x < c or x > c.
V
n
15
p
b ~ir
Problem. Solve for x if |2x + 1| > 5.
H
‘0
N
FL
—
(71
I
H
‘0
N
Solution. |2x + 1| > 4 means that either 2x + 1 < 5 or 2x + 1 > 5.
This leaves us with two di↵erent inequalities to solve. Let’s start with the
FL
inequality 2x + 1 < 5 . Subtract 1, and divide by 2 to find that x < 3.
(71
I
* * * * * * * * * * * * *
V
n
For the two rules below, a, b, c 2 R. Each rule is important for calculus.
They’ll be explained in class.
V
n
1. |ab| = |a||b|
15
2. |a c| |a b| + |b c| (triangle inequality)
236
r)
Exercises
1.) Suppose f (x) is the piecewise defined function given by
(
x + 1 if x 2 ( 1, 2);
f (x) =
x + 3 if x 2 [2, 1).
7.) Write the following numbers as integers: |8 5|, | 10 5|, and |5 5|.
The function |x 5| measures the distance between x and which number?
8.) Write the following numbers as integers: |1 2|, |3 2|, and |2 2|.
The function |x 2| measures the distance between x and which number?
238
Match the functions with their graphs.
(
2x + 1 if x 2 ( 1, 0);
17.) f (x) = 2x + 1 19.) p(x) =
1 if x 2 [0, 1).
II
1 if x 2 ( 1, 0);
18.) g(x) = 1 20.) q(x) =
2x + 1 if x 2 [0, 1).
A.) B.)
C.) D.)
II
239
a’
a’
I
Match the functions with their graphs.
(
x ex if x 6= 1;
21.) f (x) = e 23.) p(x) =
2 if x = 1.
(
ex if x 6= 1;
22.) g(x) = 2 24.) q(x) =
2 if x = 1.
A.) B.)
a’
I
C.) D.)
a’
240
a’
a’
Match the functions with their graphs.
(
p 2 if x 2 ( 1, 0);
25.) f (x) = x+2 27.) p(x) = p
x+2 if x 2 [0, 1).
a’
(
2 if x 2 ( 1, 1);
26.) g(x) = 2 28.) q(x) = p
x+2 if x 2 [1, 1).
I
A.) B.)
C.) D.)
a’
I
241
a’
a’
Simplify the expressions in #29-34.
1 2 1 4
29.) 34 30.) 4 31.) e 2
2 2 3
32.) 8 3 33.) 27 3 34.) 16 2
242