0.4 Combinations of Functions
0.4 Combinations of Functions
Sales Tax: Some states have different rates of sale tax depending on the type of item purchased. A "luxury
item" may be taxed at 12%, food may have no tax, and all other items may have a 6% tax. We could describe
this situation by using a multiline function, a function whose defining rule consists of several pieces. Which
piece of the rule we need to use will depend on what we buy. In this example we could define the tax T on an
item which costs x to be
Wind Chill Index: The rate at which a person's body loses heat depends on the temperature of the surrounding air
and on the speed of the air. You lose heat more quickly on a windy day than you do on a day with little or no wind.
Scientists have experimentally determined this rate of heat loss as a function of temperature and wind speed, and
the resulting function is called the Wind Chill Index, WCI . The WCI is the temperature on a still day (no wind) at
o
which your body would lose heat at the same rate as on the windy day. For example, the WCI value for 30 F air
o o
moving at 15 miles per hour is 9 F: your body loses heat as quickly on a 30 F day with a 15 mph wind as it
o
does on a 9 F day with no wind.
If T is the Fahrenheit temperature of the air and v is the speed of the wind in miles per hour, then the WCI is a
multiline function of the wind speed v (and of the temperature T):
⎧⎪ T if 0 ≤ v ≤ 4
10.45 + 6.69 v – 0.447v
WCI = ⎨ 91.4 – 22 (91.5 – T) if 4 ≤ v ≤ 45
⎪⎩
1.60T – 55 if v > 45
The WCI value for a still day (0 ≤ v ≤ 4 mph) is just the air temperature. The WCI values for wind speeds
above 45 mph are the same as the WCI value for a wind speed of 45 mph. The WCI values for wind speeds
between 4 mph and 45 mph decrease as the wind speeds increase.
This WCI function depends on two variables, the temperature and the wind speed. However, if the temperature is
constant, then the resulting formula for the WCI will only depend on the speed of the wind. If the air temperature
o
is 30 F (T = 30), then the formula for the Wind Chill Index is
0.4 Combinations of Functions Contemporary Calculus
2
⎪⎧ 2 if x < 0
Example 1: Define f(x) = ⎨⎪ 2x if 0 ≤ x < 2
⎩ 1 if 2 < x
Evaluate f(–3), f(0), f(1), f(4) and f(2). Graph y = f(x) for –1 ≤ x ≤ 4 .
Solution: To evaluate the function for different values of x, we must first decide which
line of the rule applies. If x = –3 < 0, then we need to use the first line of the rule,
and f(–3) = 2. When x = 0 or x = 1, we need the second line of the function
definition, and then f(0) = 2(0) = 0 and f(1) = 2(1) = 2. At x = 4 the
third line is needed, and f(4) = 1. Finally, at x = 2, none of the lines apply:
the second line requires x < 2 and the third line requires 2 < x, so f(2) is
undefined. The graph of f(x) is given in Fig. 2. Note the "hole" above
x = 2 since f(2) is not defined by this rule for f.
⎧⎪ x if x < –1
2 if –1 ≤ x < 1
Practice 2: Define g(x) = ⎨ –x if 1 < x ≤ 3 Graph y = g(x) for –3 ≤ x ≤ 6 and
⎩⎪ 1 if 4 < x.
evaluate g(–3), g(–1), g(0), g(1/2), g(1), g(π/3), g(2), g(3), g(4) and g(5) .
Definition: The composite of two functions f and g , written f°g , is f° g(x) ≡ f( g(x) ).
The domain of the composite function f °g(x) = f( g(x) ) consists of those x–values for which g(x) and
f( g(x) ) are both defined –– we can evaluate the composition of two functions at a point x only if each step in
the composition is defined.
Example 2:
2
For f(x) = x – 2 , g(x) = x , and h(x) = { 3xx – 1 if x < 2
if 2 ≤ x ,
evaluate f°g(3), g °f(6), f °h(2) and h °g(–3). Find the equations and domains of f°g(x) and g °f(x).
2
Solution: f°g(3) = f( g(3) ) = f( 3 ) = f( 9 ) = 9–2 = 7 ≈ 2.646
2
g°f(6) = g( f(6) ) = g( 6 – 2 ) = g( 4 ) = g( 2 ) = 2 = 4
f°h(2) = f( h(2) ) = f( 2 – 1 ) = f( 1 ) = 1–2 = –1 which is undefined
h°g(–3) = h( g(–3) ) = h( 9 ) = 9 – 1 = 8.
2 2
f°g(x) = f( g(x) ) = f( x ) = x – 2 , and the domain of f°g is those x–values for which
2
x – 2 ≥ 0 so the domain of f°g is all x such that x ≥ 2 or x ≤ – 2 .
g°f(x) = g( f(x) ) = g( x – 2 )={ x–2 }2 = x – 2 , but we can evaluate the first piece, f, of the
composition only if f(x) = x – 2 is defined, so the domain of g °f is all x ≥ 2.
x 2x if x ≤ 1
Practice 4: For f(x) = x–3 , g(x) = 1+x , and h(x) = 5 – x { if 1 < x.
Evaluate f°g(3), f °g(8), g °f(4), f °h(1), f°h(3), f°h(2) and h°g(–1). Find the equations for f °g(x) and g°f(x).
We could also get these results by examining the graph of y = f(x), creating a table of values for f(x)
0.4 Combinations of Functions Contemporary Calculus
5
and the new functions, and then graphing the new functions.
Iteration of Functions
There are applications which feed the output from a function machine
back into the same machine as the new input. Each time through the
machine is called an iteration of the function.
5/x + x
Example 4: Suppose f(x) = 2 , and we start with the
Once we have obtained the output 2.236067977, we will just keep getting the same output. You might
recognize this output value as 5 . This algorithm always finds ± 5 . If we start with any positive input, the
0.4 Combinations of Functions Contemporary Calculus
6
values will eventually get as close to 5 as we want. Starting with any negative value for the input will
eventually get us to – 5 . We cannot start with x = 0, since 5/0 is undefined.
Practice 6: What happens if we start with the input value x = 1 and iterate the function
9/x + x
f(x) = 2 several times? Do you recognize the resulting number? What do you think will
A/x + x
happen to the iterates of g(x) = 2 ? (Try several positive values of A.)
These two functions have useful properties which let us describe situations in which an object abruptly changes
direction or jumps from one value to another value. Their graphs will have corners and breaks.
The absolute value function of a number x, y = f(x) = | x | , is the distance between the number x and 0. If x
is greater than or equal to 0, then | x | is simply x – 0 = x . If x is negative, then | x | is 0 – x = –x = –1.x
which is positive since –1.(negative number) = a positive number. On some calculators and in some computer
programming languages, the absolute value function is represented by ABS(x) .
The domain of y = f(x) = | x | consists of all real numbers. The range of f(x) = | x | consists of all numbers
larger than or equal to zero, all non–negative numbers. The graph of y = f(x) = | x |
(Fig. 10) has no holes or breaks, but it does have a sharp corner at x = 0. The
absolute value will be useful later for describing phenomena such as reflected light
and bouncing balls which change direction abruptly or whose graphs have corners.
The absolute value function has a number of properties which we will use later.
Taking the absolute value of a function has an interesting effect on the graph of the function. Since
|x|= { x–x if x ≥ 0
if x < 0 , then for any function f(x) we have | f(x) | = {f(x)
–f(x)
if f(x) ≥ 0
if f(x) < 0.
0.4 Combinations of Functions Contemporary Calculus
7
In other words, if f(x) ≥ 0, then | f(x) | = f(x) so the graph of | f(x) | is the same as the graph of f(x). If
f(x) < 0, then | f(x) | = –f(x) so the graph of | f(x) | is just the graph of f(x) "flipped" about the
x–axis, and it lies above the x–axis. The graph of | f(x) | will always be on or above the x–axis.
Example 5: Fig. 11 shows the graph of f(x). Graph (a) | f(x) | , (b) | 1 + f(x) |
and (c) 1 + | f(x) |.
Solution: The graphs are given in Fig. 12. In (b) we shift the graph of f
up 1 unit before taking the absolute value. In (c) we take the absolute
value before shifting the graph up 1 unit.
Practice 7: Fig. 13 shows the graph of g(x). Graph (a) | g(x) | , (b) | g(x – 1) | ,
and (c) g( | x | ).
The greatest integer function of a number x , y = f(x) = [ x ] , is the largest integer which is less than or equal
to x . The value of [ x ] is always an integer and [ x ] is always less than or equal to x. For example, [ 3.2 ]
= 3, [ 3.9 ] = 3, and [ 3 ] = 3. If x is positive, then [ x ] truncates x (drops the fractional part of x) to get [ x
]. If x is negative, the situation is different: [ –4.2 ] ≠ –4 since –4 is not less than or equal to –4.2 : [ –4.2 ] =
– 5, [ –4.7 ] = –5 and [ –4 ] = –4. On some calculators and in many programming languages the square
brackets [ ] are used for grouping objects or for lists, and the greatest integer function is represented by INT(x)
.
⎧⎪ x if x is an integer
= ⎨
⎩⎪ largest integer strictly
less than x
if x is NOT an integer.
0.4 Combinations of Functions Contemporary Calculus
8
The domain of The f(x) = [ x ] is all real numbers. The range of f(x) = [ x
] is only the integers. The graph of y = f(x) = [ x ] is shown in Fig. 14.
It has a jump break, a step, at each integer value of x, and f(x) = [ x ] is
called a step function. Between any two consecutive integers, the graph is
horizontal with no breaks or holes. The greatest integer function is useful
for describing phenomena which change values abruptly such as postage
rates as a function of the weight of the letter ("26¢ for the first ounce and
13¢ additional for each additional half ounce"). It can also be used for functions whose graphs are "square
waves" such as the on and off of a flashing light.
2
Practice 8: Sketch the graph of y = INT( x ) for –2 ≤ x ≤ 2 .
Fact: "Every interval contains both rational and irrational numbers" or, equivalently,
The Fact tells us that between any two places where the y = h(x) = 1 (because x is rational) there is a place where
y = h(x) is 2 because there is an irrational number between any two distinct rational numbers. Similarly,
between any two places where y = h(x) = 2 (because x is irrational) there
is a place where y = h(x) = 1 because there is a rational number between any two distinct irrational numbers.
The graph of y = h(x) is impossible to actually draw since every two points on the graph are separated by a hole.
This is also an example of a function which your computer or calculator can not graph because in general it can
not determine whether an input value of x is irrational.
PROBLEMS !
1. If T is the Celsius temperature of the air and v is the speed of the wind in kilometers per hour, then
2. Use the graph of y = f(x) in Fig. 18 to evaluate f(0), f(1), f(2), f(3), f(4)
and f(5). Write a multiline function definition for f.
3. Use the graph of y = g(x) in Fig. 19 to evaluate g(0), g(1), g(2), g(3),
g(4) and g(5). Write a multiline function definition for g.
4. Use the values given in the table and h(x) = 2x + 1 to determine the values
of f°g , g °f and h °g.
–1 2 0
0 1 2
1 –1 1
2 0 2
9. You are planning to take a one week vacation in Europe, and the tour brochure says that Monday and
Tuesday will be spent in England, Wednesday in France, Thursday and Friday in Germany, and Saturday
and Sunday in Italy. Let L(d) be the location of the tour group on day d and write a multiline function
definition for L(d).
10. A state has just adopted the following state income tax system: no tax on the first $10,000 earned,
1% of the next $10,000 earned, 2% of the next $20,000 earned, and 3% of all additional earnings. Write a
multiline function definition for T(x), the state income tax due on earnings of x dollars.
11. Write a multiline function definition for the curve y = f(x) in Fig. 22.
12. Define B(x) to be the area of the rectangle whose lower left corner is at the
origin and whose upper right corner is at the point (x, f(x) ) for the function
f in Fig. 23. Then, for example, B(3)=6. Evaluate B(1), B(2), B(4) and B(5)
13. Define B(x) to be the area of the rectangle whose lower left corner is at the
origin and whose upper right corner is at the point (x, 1/x ).
a) Evaluate B(1), B(2) and B(3).
b) Show that B(x) = 1 for all x > 0.
17. (a) Let f(x) = 3x + 2 and g(x) = 2x + A. Find a value for A so that
f( g(x) ) = g( f(x) ).
(b) Let f(x) = 3x + 2 and g(x) = Bx – 1. Find a value for B so that
f( g(x) ) = g( f(x) ).
18. (a) Let f(x) = Cx + 3 and g(x) = Cx – 1. Find a value for C so that
f( g(x) ) = g( f(x) ).
(b) Let f(x) = 2x + D and g(x) = 3x + D. Find a value for D so that
f( g(x) ) = g( f(x) ).
0.4 Combinations of Functions Contemporary Calculus
12
19. Graph y = f(x) = x – INT(x) for –1 ≤ x ≤ 3. This function is called the "fractional part of x" and is an
example of a "sawtooth" graph.
INT(10x + 0.5)
20. f(x) = INT(x + 0.5) rounds off x to the NEAREST integer. g(x) = 10 rounds off x to
the nearest tenth, the first decimal place. What function will round off x to (a) the nearest hundredth (2
decimal places)? (b) the nearest thousandth (3 decimal places)?
21. Modify the function in example 6 to produce a "square wave" graph with a "long on, short off, long
on, short off" pattern.
22. Some versions of the computer language BASIC contain a "signum" or "sign" function defined by
⎪⎧ 1if x > 0
SGN( x ) = ⎨⎪ 0if x = 0 .
⎩ –1if x < 0
23. Define g(x) to be the slope of the line tangent to the graph of y = f(x)
in Fig. 26 at (x,y).
(a) Estimate g(1), g(2), g(3) and g(4).
(b) Graph y = g(x) for 0 ≤ x ≤ 4 .
24. Define h(x) to be the slope of the line tangent to the graph of y = f(x)
in Fig. 27 at (x,y).
(a) Estimate h(1), h(2), h(3) and h(4).
(b) Graph y = h(x) for 0 ≤ x ≤ 4 .
C25. Pressing the COS (cosine) button on your calculator several times will produce
iterates of f(x) = cos(x). What number will the iterates approach if you start with
x = 1 and press the COS button 20 or 30 times? What happens if you start with
x = 2 or x = 10? (Be sure your calculator is in radian mode.)
C26. Let f(x) = 1 + sin(x). What happens if you start with x = 1 and repeatedly feed the output from f
back into f ? What happens if we start with x = 2 and examine the iterates of f ? (Be sure your
calculator is in radian mode.)
2
x +1
C27. Starting with x = 1, do the iterates of f(x) = 2x approach a number? What happens if you
start with x = .5 or x = 4?
0.4 Combinations of Functions Contemporary Calculus
13
x
C28. Let f(x) = 2 + 3 . (a) What are the iterates of f if you start with x = 2? 4? 6?
(b) Find a number c so that f(c) = c. This value of c is called a fixed point of f.
x
(c) Find a fixed point of g(x) = 2 + A.
x
C29. Let f(x) = 3 + 4. (a) What are the iterates of f if you start with x = 2? 4? 6?
x
(b) Find a number c so that f(c) = c. (c) Find a fixed point of g(x) = 3 + A.
30. Start with an equilateral triangle with sides of length 1 (Fig, 28a).
(i) Remove the middle third of each line segment.
(ii) Replace the removed portion with 2 segments with the same length as the removed segment.
The first two iterations of this procedure are shown in Fig. 28b and Fig. 28c. Repeat steps (i) and (ii)
several more times, each time removing the middle third of each line segment and replacing it with two new
segments. What happens to the length of the shape with each iteration? (The result of iterating over and
over with this procedure is called Koch's Snowflake, named for Helga von Koch)
!
0.4 Combinations of Functions Contemporary Calculus
14
⎪⎧ 1 if x ≤ –1
Practice 3: f(x) = ⎨⎪ 1 – x if –1 < x ≤ 1
⎩ 2 if 1 < x
9/x + x
Practice 6: f(x) = 2 .
9/1 + 1 9/5 + 5
f(1) = 2 = 5, f(5) = 2 = 3.4, f(3.4) ≈ 3.023529412,
!
0.4 Combinations of Functions Contemporary Calculus
15
Practice 7: Fig. 31 shows some of the intermediate steps and final graphs.
2
Practice 8: Fig. 32 shows the graph of y = x
2
and the graph (thicker) of y = INT( x ) .