Precalculus Study Guide
Copyright Maplesoft, a division of Waterloo Maple Inc., 2024
Chapter 10: Piecewise-Defined Functions
Introduction
A piecewise-defined function is an amalgam of two or more rules, each operative on its own domain. In general, these domains are contiguous, but that is not an essential element of the definition.
Some piecewise functions have special names that are used the way the name of the sine or exponential functions might be used. Two, in particular, are x and x, the first being the absolute-value function, and the second, the greatest-integer function. These are met in the next two sections below. The general manipulation of piecewise-defined functions is thus the object of this chapter.
Chapter Glossary
The following terms in Chapter 10 are linked to the Maple Math Dictionary.
absolute value
additive inverse
denominator
domain
exponential
extension
greatest integer function
inequality
interval
negative
nonnegative
numerator
positive
real line
real number
sine
singularity
subset
The Piecewise-Defined Function x
As was seen in Chapter 1, the absolute value function, written as
f⁡x=x
is always a nonnegative quantity. For example, the absolute value of −3 is the positive number 3.
Viewing the change from −3 to 3 as "dropping the minus sign" obscures the abstract definition of this function.
It's much better to see the transition of −3 to 3 as attained by multiplying the negative number −3 by −1 to form +3, the additive inverse of −3. Hence, the action of the absolute value function should be seen as
−3= −−3 = 3
that is, don't drop a minus sign, but make the negative number positive by introducing a second minus sign. This is worth repeating.
Make a negative number positive by negating the negative number
If this is completely understood, then the abstract definition of the absolute value function, namely,
x={−x x<00 x=0x x⁢>0
is easier to understand. If x is already know to be a negative number, it is made positive by putting a minus sign in front of it. If x is zero, its absolute value remains zero. If x is positive, then its absolute value is itself, so x remains unchanged.
The abstract definition of the absolute value function just given is an example of a piecewise-defined function. In general, a piecewise-defined function has more than one rule, and each rule is applied for a specific set of values in the domain of the function.
A Maple implementation of the absolute-value function as a piecewise-defined function is given in Table 10.0.1.
convert(x, piecewise)
Table 10.0.1 Maple's implementation of x as a piecewise function
Notice how the value at x=0 is included in the case of positive x.
Table 10.0.2 shows the Maple piecewise command used to reproduce the absolute-value function.
piecewisex<0,−x,x
Table 10.0.2 The absolute-value function via Maple's piecewise command
Note the use of "otherwise" to represent the complement of the case x<0. Hence, it represents the case x≥0.
The Greatest-Integer Function x
If x is a real number, the symbol x typically denotes the greatest integer that is less than or equal to x. This defines the greatest-integer function
x = the greatest integer n that satisfies the condition n≤x
In effect, this is a piecewise-defined function with an infinite number of rules. A piecewise representation of the greatest-integer function would look something like the following.
x={ ⋮ ⋮−2 −2≤x<−1−1−1≤x<00 0≤x<11 1≤x<22 2≤x<3⋮ ⋮
Those who think visually and geometrically would see x as x itself whenever x is an integer, and as the integer on the number line that is just to the left of x whenever x is not an integer.
Maple's floor function is an implementation of the greatest-integer function. Some specific values are listed in Table 10.0.3.
−2.4 = floor−2.4;−1.5 = floor−1.5;−0.7 = floor−.7;0.8 = floor.8;1.25 = floor1.25;2.78 = floor2.78
Table 10.0.3 Some values of x as given by Maple's floor command
A portion of the graph of f⁡x=x is shown in Figure 10.0.1.
Figure 10.0.1 Portion of the graph of x=floorx
Typical Problems
10.1. Graph the function fx=2 x+1x<−11x≤1x2x<23−xotherwise on the interval −2,4, and obtain the value f⁡2.
10.2. Compare the functions f⁡x=x2−1x−1,g⁡x=x+1, and h⁡x={x2−1x−1 x≠12 x=1.
10.3. Graph f⁡x=x+x on the interval −3,3.
10.4. Graph f⁡x=x−x on the interval −3,3.
10.5. Represent f⁡x=3⁢x−5+2 as a piecewise-defined function, and obtain its graph on the interval −1,4.
10.6. Represent f⁡x=1−2⁢x−3⁢x2 as a piecewise-defined function, and obtain its graph on the interval −2,2.
Maple Initializations
Before accessing the Maple version of the solutions to the typical problems stated above, initialize Maple by pressing the button provided on the right.
Solutions
Problem 10.1
10.1 - Mathematical Solution
The graph of the function
fx=2 x+1x<−11x≤1x2x<23−xotherwise
on the interval −2,4 appears in Figure 10.1.1.
At x=2, the value of f⁡x is f⁡2=1.
Figure 10.1.1 Graph of piecewise-defined f⁡x
10.1 - Maplet Solution
A graph of the function
on the interval −2,4, and the value f⁡2, can be found with the Piecewise Function Tutor .
Clicking this link will launch the tutor with the solution embedded as shown in the thumbnail image in Figure 10.1.2.
A piecewise function with up to four different rules can be entered rule-by-rule as a function of type Format 2.
Figure 10.1.2 Thumbnail image of the Piecewise Function Tutor
The Graph Format 2 button is used to generate the required graph. The Plot Options button should be used to limit the domain to the given interval −2,4.
The value f⁡2=1 is found by entering x=2 in the Evaluation section, and clicking the button labeled Evaluate f⁡x Format 2.
To launch the Piecewise Function Tutor, click the following link: Piecewise Function Tutor
10.1 - Interactive Solution
Enter the piecewise function
A piecewise function can be created interactively by means of -xx<axx≥a, the piecewise template in the Expression palette. Move through the fields of the template using the Tab key.
Use Control + Shift + r to generate additional rows.
Complete the equation fx=… with the piecewise function.
Context Panel: Assign Function
Graph fx
Type fx and press the Enter key.
Context Panel: Plots≻Plot Builder −2≤x≤4 Options: Find Discontinuities
Obtain f2
Type f2
Context Panel: Evaluate and Display Inline
10.1 - Programmatic Solution
If the function
is entered into Maple as the expression
f ≔ piecewisex<−1,2 x+1, x≤1,1, x<2,x2, 3−x
then f⁡2 is obtained with
evalf, x=2
and the graph of f⁡x is obtained as Figure 10.1.2 with
plot⁡f,x=−2..4,discont=true
Figure 10.1.2 Graph of piecewise-defined f⁡x
If the given function is entered into Maple as a Maple function, then appropriate syntax would be
F ≔ x → piecewisex<−1,2 x+1, x≤1,1, x<2,x2, 3−x
Because this mode of entry does not display the "echelon" form of the piecewise function, the following alternate strategy can be used.
F ≔ x → piecewisex<−1,2 x+1, x≤1,1, x<2,x2, 3−x:'F'x = Fx
in which case the value f⁡2 is obtained with
F2
Problem 10.2
10.2 - Mathematical Solution
Let us compare the functions f⁡x=x2−1x−1,g⁡x=x+1, and hx=x2−1x−1x≠12x=1.
It is tempting to write
f⁡x=x2−1x−1 = x+1⁢x−1x−1=x+1 = g⁡x
but this is naive and incorrect. Although more cumbersome, it would be clearer to write
f⁡x=x2−1x−1 = x+1⁢x−1x−1 = {x+1 x≠1undefined x=1
By convention, the domain of a function is the largest subset of the real numbers for which its rule is valid.
The function f⁡x is not defined at x=1, but the function g⁡x is defined there, and has the value 2. Thus, f⁡x≠g⁡x, that is, the functions f⁡x and g⁡x are not the same. Their domains are not the same. The domain of g⁡x contains one more point than the domain of f⁡x. In that sense, g⁡x is an extension of f⁡x; that is, g⁡x agrees with f⁡x at all points in their common domains, but g⁡x is defined for at least one point where f⁡x isn't.
The function h⁡x agrees everywhere with g⁡x. Their domains are the same, namely, the set of all real numbers, and their values agree at every real number. Hence, h⁡x=g⁡x.
10.2 - Maplet Solution
The three functions
f⁡x=x2−1x−1
g⁡x=x+1
hx=x2−1x−1x≠12x=1
can be compared with the Removable Singularity Tutor .
Clicking this link will launch the tutor with the solution embedded as shown in the thumbnail image in Figure 10.2.1.
Figure 10.2.1 Thumbnail image of the Removable Singularity Tutor
The numerator and denominator of the function f⁡x are entered separately, and the button labeled Set of singularities provides the set A=1 containing the singularities of f⁡x.
The button labeled Piecewise form for f⁡x expresses f⁡x in the piecewise form
f⁡x={x2−1x−1 x≠1undefined x=1
The button labeled Incorrect simplification of f⁡x produces the function
a function that is not equivalent to f⁡x. This function is an extension of f⁡x because it agrees with f⁡x at all points in the domain of f⁡x, but its domain contains (at least) one more point than the domain of f⁡x.
The button labeled Piecewise form of g⁡x produces the function
which is equivalent to g⁡x. Thus, the singularity of f⁡x at x=1 can be removed by defining a new function that gives a value for f⁡1. This new function can be written either in piecewise form as h⁡x or as g⁡x.
To launch the Removable Singularity Tutor, click the following link: Removable Singularity Tutor
10.2 - Interactive Solution
Type x2−1x−1, the rule for fx
Context Panel: Simplify≻Simplify
Maple simplifies fx to x+1 because Maple functions and expressions don't carry domain information.
Unfortunately, this means Maple is incorrect when making this simplification.
Type x2−1x−1x≠12x=1, the rule for hx
Maple simplifies hx to x+1. Although this is a correct simplification, Maple really doesn't "understand" why this is correct and the simplification of fx is not.
10.2 - Programmatic Solution
but this is naive and incorrect. Although more cumbersome, it would be better to write
In fact, as difficult as it is for Maple to produce, Figure 10.2.2 shows f⁡x to be linear, except for the the gap or "hole" at x=1.
plot⁡x2−xx−1,x=0..2,sample=seq⁡k50,k=0..100,adaptive=false,thickness=2
Figure 10.2.2 Graph of f⁡x=x2−1x−1
Problem 10.3
10.3 - Mathematical Solution
The graph of
f⁡x=x+x
on the interval −3,3 appears in Figure 10.3.1.
Recall thatx is the "greatest integer" function that returns the greatest integer that is less than or equal to x.
Figure 10.3.1 Graph of f⁡x=x+x
10.3 - Maplet Solution
Provided that x, the greatest-integer function, is rendered as floor⁡x in Maple, a graph of the function
on the interval −3,3 can be obtained with the Piecewise Function Tutor .
Clicking this link will launch the tutor with the solution embedded as shown in the thumbnail image in Figure 10.3.2.
Enter f⁡x=x+floor⁡x as a function in Format 1.
Because the domain of x is the whole real line, expressing it as a piecewise-defined function would require an infinite number of rules. Hence, the Piecewise Function Tutor does not write this function in "echelon" form.
Figure 10.3.2 Thumbnail image of the Piecewise Function Tutor
The required graph is obtained by clicking on the button labeled Graph Format 1.
10.3 - Interactive Solution
Type x+Floorx
Context Panel: Plots≻Plot Builder −3≤x≤3 Options: Find Discontinuities
Alternatively
Type x
Context Panel: Integer Functions≻Floor
Control-drag Floorx and append to it +x
Press the Enter key.
Context Panel: Plots≻Plot Builder
10.3 - Programmatic Solution
The graph of f⁡x=x+x appears in Figure 10.3.3.
plot⁡x+floor⁡x,x=−3..3,discont=true,scaling=constrained
Figure 10.3.3 Graph of f⁡x=x+x
Problem 10.4
10.4 - Mathematical Solution
Figure 10.4.1 contains a graph of
f⁡x=x−x
drawn on the interval −3,3.
Figure 10.4.1 Graph of f⁡x=x−x
10.4 - Maplet Solution
fx=x−x
Clicking this link will launch the tutor with the solution embedded as shown in the thumbnail image in Figure 10.4.2.
Enter fx=x−floorx as a function in Format 1.
Figure 10.4.2 Thumbnail image of the Piecewise Function Tutor
10.4 - Interactive Solution
Type x−Floorx
Type x− and Control-drag Floorx
10.4 - Programmatic Solution
The graph of f⁡x=x−x appears in Figure 10.4.3.
plot⁡x−floor⁡x,x=−3..3,discont=true,scaling=constrained,tickmarks=7,2
Figure 10.4.3 Graph of f⁡x=x−x
Problem 10.5
10.5 - Mathematical Solution
Converting the function f⁡x=3⁢x−5+2 from the absolute value notation to piecewise notation requires knowing where 3⁢x−5 changes from negative to positive. Thus, one could solve the equation
3⁢x−5=0
for x=5/3. Alternatively, one could solve the inequalities
3⁢x−5<0
and
3⁢x−5 >0
for
x<5/3
x⁢>5/3
respectively.
Thus, when x<5/3, the expression 3⁢x−5 is negative, so f⁡x becomes −3⁢x−5+2=7−3⁢x.
When x⁢>5/3, the expression 3⁢x−5 is positive, so f⁡x becomes⁡3⁢x−5+2=3⁢x−3.
When x=5/3, both expressions reduce to 2, so it does not matter where the equality condition is included in the piecewise definition.
Thus, the piecewise form of f⁡x would be
fx=7−3 xx<533 x−3x≥53
Figure 10.5.1 provides a graph of this function.
Figure 10.5.1 Graph of f⁡x=3⁢x−5+2
10.5 - Maplet Solution
To represent the function
f⁡x=3⁢x−5+2
as a piecewise-defined function, and to obtain its graph on the interval −1,4, use the Piecewise Function Tutor .
Clicking this link will launch the tutor with the solution embedded as shown in the thumbnail image in Figure 10.5.2.
As required for Format 1 functions, enter 3⁢x−5 as abs(3*x-5).
Then, click the button labeled Convert to piecewise to obtain the "echelon" representation of this function.
Figure 10.5.2 Thumbnail image of the Piecewise Function Tutor
Clicking the button labeled Graph Format 1 will give the required graph, provided the Plot Options button has been used to set the plot range to the required domain.
10.5 - Interactive Solution
Type 3 x−5+2
Context Panel: Apply a Command Apply the command≻convert Append the arguments≻piecewise
Context Panel: Plots≻Plot Builder −1≤x≤4 Options≻0≤y≤11
Solution from First Principles
Type 3 x−5<0
Context Panel: Solve≻Solve
Type 3 x−5>0
Type −3 x−5+2
Use -xx<axx≥a, the piecewise function template from the Expression palette to obtain fx in piecewise form.
10.5 - Programmatic Solution
The function f⁡x=3⁢x−5+2, given in Maple by
f ≔ abs3 x−5+2
can be represented as the piecewise function
convertf,piecewise
The graph of f⁡x is found in Figure 10.5.3.
plot⁡f,x=−1..4,y=0..11
Figure 10.5.3 Graph of f⁡x=3⁢x−5+2
Converting from the absolute value notation to the piecewise notation requires knowing where 3⁢x−5 changes from negative to positive. Thus, one could solve the equation
q ≔ 3 x−5 = 0
and obtain
solveq,x
On the other hand, one could solve the inequalities
q1 ≔ 3 x−5 < 0;q2 ≔ 3 x−5 > 0
obtaining
solveq1,x;solveq2,x
Problem 10.6
10.6 - Mathematical Solution
Converting the function f⁡x=1−2⁢x−3⁢x2 from absolute value notation to piecewise notation requires knowing where 1−2⁢x−3⁢x2 changes from negative to positive. Thus, one could solve the equation
1−2⁢x−3⁢x2=0
by the quadratic formula, obtaining x=−1 and x=1/3 .
Alternatively, one could solve the inequalities
1−2⁢x−3⁢x2<0
1−2⁢x−3⁢x2>0
x<−1∪{ x⁢>1/3 }
−1<x<1/3
Thus, when x<−1, or when x⁢>1/3, the expression 1−2⁢x−3⁢x2 is negative, so f⁡x becomes
−1−2⁢x−3⁢x2=3⁢x2+2⁢x−1
When −1<x<1/3 the expression 1−2⁢x−3⁢x2 is positive, so f⁡x becomes 1−2⁢x−3⁢x2.
When x=1/3 or when x=−1, both expressions reduce to 0, so it does not matter where the equality condition is included in the piecewise definition.
This function is graphed in Figure 10.6.1.
Figure 10.6.1 Graph of f⁡x=1−2⁢x−3⁢x2
10.6 - Maplet Solution
f⁡x=1−2⁢x−3⁢x2
as a piecewise-defined function, and to obtain its graph on the interval −2,2, use the Piecewise Function Tutor .
Clicking this link will launch the tutor with the solution embedded as shown in the thumbnail image in Figure 10.6.2.
As required for Format 1 functions, enter f⁡x as
abs(1-2*x-3*x^2)
Then, click the button labeled Convert to piecewise to obtain the following "echelon" representation of this function.
Figure 10.6.2 Thumbnail image of the Piecewise Function Tutor
fx=−1+2 x+3 x2x≤−11−2 x−3 x2x<1/3−1+2 x+3 x2x≥1/3
10.6 - Interactive Solution
Type 1−2 x−3 x2
Context Panel: Assign to a Name≻g
Type g
Context Panel: Plots≻Plot Builder −2≤x≤2 Options≻0≤y≤15
Type g<0
Type g>0
Use -xx<axx≥a, the piecewise function template from the Expression palette, to obtain fx in piecewise form. Add additional "rows" with Ctrl + Shift + r
10.6 - Programmatic Solution
The function f⁡x=1−2⁢x−3⁢x2, given in Maple by
f ≔ abs1−2 x−3 x2
The graph of f⁡x is found in Figure 10.6.3.
plot⁡f,x=−2..2,y=0..15
Figure 10.6.3 Graph of f⁡x=1−2⁢x−3⁢x2
Converting from the absolute value notation to the piecewise notation requires knowing where 1−2⁢x−3⁢x2 changes from negative to positive. Thus, one could solve the equation
q ≔ 1−2 x−3 x2 = 0
q1 ≔ 1−2 x−3 x2 < 0;q2 ≔ 1−2 x−3 x2 > 0
Exercises - Chapter 10
10.1. For x in the interval −1,1, graph the piecewise-defined function f⁡x={x2−1 x<01−x2 otherwise .
10.2. For x in the interval −π,π, graph the piecewise-defined function f⁡x={−sin⁡x x<0sin⁡x otherwise.
10.3. For x in the interval −1,1, graph the piecewise-defined function f⁡x={2+x x<−11 x<12−x otherwise.
10.4. For x in the interval −3,3, graph the piecewise-defined function f⁡x={1+x⁢x+3 x<−10 x<1−1+x⁢3−x otherwise.
10.5. For x in the interval −1,1, graph the piecewise-defined function f⁡x={ⅇx x<0ⅇ−x 0≤x.
10.6. For x in the interval −2,2, graph the piecewise-defined function f⁡x={−2−x x<−1−1 x<01 x<12−x otherwise.
10.7. For x in the interval −3,3, graph the piecewise-defined function f⁡x={−3−x x<−1−1+x x<01+x x<13−x otherwise.
In Exercises 10.8 - 10.10, compare the functions f⁡x,g⁡x, and h⁡x.
10.8. f⁡x=x2−x−2x−2,g⁡x=x+1, h⁡x={x2−x−2x−2 x≠23 x=2
10.9. f⁡x=3⁢x2+8⁢x−3x+3,g⁡x=x+3, h⁡x={3⁢x2+8⁢x−3x+3 x≠−3−10 x=−3
10.10. f⁡x=x−9x−3,g⁡x=x+3, h⁡x={x−9x−3 x≠96 x=9
10.11. Graph f⁡x=3⁢x+2⁢x on the interval −3,3.
10.12. Graph f⁡x=3⁢x−2⁢x on the interval −3,3.
10.13. Represent f⁡x=3⁢1−2⁢x+4 as a piecewise-defined function, and obtain its graph on the interval −2,3.
10.14. Represent f⁡x=1−2⁢3⁢x+4 as a piecewise-defined function, and obtain its graph on the interval −3,1.
10.15. Represent f⁡x=x2−3⁢x+2 as a piecewise-defined function, and obtain its graph on the interval 0,3.
10.16. Represent f⁡x=12+x−x2 as a piecewise-defined function, and obtain its graph on the interval −4,5.
Go to Chapter 1 2 3 4 5 6 7 8 9 11
Go to Contents
Download Help Document