Chapter 21
Functions
21.1 Welcome to the Machine
Consider the line given by the standard form equation
-3 x + 4y = 12.
In our discussion of analytic geometry, we treated this line solely as a geometric figure, defined by
the points (x, y) satisfying the equation. However, there is another very productive way to look at
such a line. Change the equation into slope-intercept form:
y = \ x + 3.
Now for each x we put in, running it through the procedure \x + 3 automatically gives back the
corresponding y. We can thus think of the line equation as a machine which, for each x we put in,
gives us back one, and only one, y.
EXERCISE 21-1 Do all line equations give back one, and only one, y for each x?
The "machine," given by \x + 3, is called a function. A function always has one, and only one,
output for each input; for this reason, not every expression is a function. For example, yfx is not
a valid function, since most numbers have two square roots—if we tried to take Vl, we would
not know whether the machine should produce 1 or -1 . We can make the square root a function,
however, by specifying that we will take only the positive answer.
When we wish to treat an equation as a function, we no longer write it using x and y, which
seems to imply a parallelism between the two variables. Instead, we give the machine part a name
of its own, like /. To show that / is a function of the variable x, we usually write it as f(x), which is
pronounced "/ of x." We would thus rewrite our line equation as
/(*) = ! * + 3. (21.1)
< 187 >
188 > CHAPTER 21. FUNCTIONS
EXERCISE 21-2 Which of the following are functions?
i. ^
ii. tfc
iii. x/(x +1)
EXAMPLE 21-1 If r(x) = x/(x2 + 1), find r(-l), r(0), and r(2).
Solution: We just substitute the input into the machine and turn the crank, so that r ( - 1) =
(-l)/ [(-l)2 + 1] = -1/2, r(0) = 0/1 = 0, and r(2) = 2/(22 + 1)= 2/5.______________________________
EXERCISE 21-3 For each of the functions f(x) in Exercise 21-2, find /(64).
EXERCISE 21-4 If f(x) = 2X, find /(4)//(3).
EXERCISE 21-5 Given that f(x + 1) = x3 + 6x2 + x + 3, find / ( 4). (MA© 1987)
21.2 Graphing Functions
A function is graphed in the same way as a normal equation is. On the horizontal axis we place
the independent variable (x in this case), which can vary freely. On the vertical is the value of the
function. The graph of Equation 21.1 is thus the same as if we were graphing the line equation
y = |x + 3, with the difference that the vertical axis is called f(x), rather than y.
A common test to check if a graph represents a function is that if any vertical line passes through
more than one point of the curve, the curve does not represent a function. Compare this to the
statement that a function gives only one output for every x.
EXAMPLE 21-2 Graph the function f(x) = x2
Solution: The simplest way to do this is simply to plug in values of x.
For each, we find the value of the function and plot the point (x ,f(x )). If
x = 0, f(x) = 0. If x = 1 or x = -1 , then f(x) = 1. (Note that two different
x values can go to a single f(x); a single x just cannot go to two values of
/(*).) If x = 2 or x = -2 , f(x) = 4. If x = 3 or x = -3 , f(x) = 9. If we plot
these few points, we can see what the basic shape of the curve must be,
and fill it in. The result is at right.
EXERCISE 21-6 G ra p h th e fu n ctio n s f(x) = x3 an d h(x) = x3 + 3.
EXERCISE 21-7 Graph the function /(x ) = ^ . . (You will have to use some non-integral values
for x to get an idea of the shape near x = 0.)
the ART of PROBLEM SOLVING < 189
21.3 Inputs and Outputs
In examples above, we've examined how to graph several different functions. Consider graphing
the function f(x) = 1/(1 - x2). When we plug in x = 1, we find that f(x) is undefined, because it is
a fraction with denominator 0. Thus the point x = 1 is not allowed as an input to the function, and
neither is x = -1 .
The set of allowable inputs to a function is called the domain; the domain of f(x) in this case is
all real numbers except x = ±1. The domains of all the functions from the previous section are all
reals. Unless specified otherwise, you can almost always assume that the domain is restricted to the
reals, rather than allowing complex inputs. You can also generally assume that complex outputs are
forbidden, so that -1 is not in the domain of y/x.
EXAMPLE 21-3 What is the domain of log x?
Solution: The logarithm of x is the number y such that 10y = x. If x > 0, there will always
be such a number y, but for x < 0 there can be no such power. Thus the domain is the positive real
numbers.
EXERCISE 21-8 Plot /(x) = log2 x.
EXERCISE 21-9 Find the domains of:
x2 + 3 x -2
»•/(*) x2 - 3 x + 2'
ii. h{y) = 2y. (Note that the input variable does not have to be called x.)
iii. g(t) = Vf, where the positive square root is the one taken.
Just as the domain of a function is the set of allowed inputs, the range is defined as the set of all
outputs of the function. For example, the range of x2 - 1 is all numbers greater than or equal to -1 ,
the range of 1/x is all real numbers except zero, and the range of the line function of Section 21.1
is all reals. (Make sure you understand all of these.) As was noted above, the outputs are almost
always restricted to the reals, rather than allowing complex outputs. You can usually find the range
of a function with pure common sense through thinking about what the outputs can be.
EXAMPLE 21-4 Find the range of 2X.
Solution: A power of a positive number is always positive, but can be any positive number,
as you should have observed in the previous set of examples. Thus the range is the positive real
numbers.
EXERCISE 21-10 Find the ranges of log x, x2 + 1, and l/(x - 1).
EXERCISE 21-11 Find the range of x/(x + 1). You will probably need to draw a graph.
Given a function f(x), one thing that can be done is to create a new function in which you put
an input x into /, then take the output, /(x), and put it through again, if it can go through. (That is,
if it is in the domain of /.) The result is /(/(*)). We can play this game as many times as we wish,
as long as each output is still in the domain of /. The function /(/(• ••f(x) •••)), with n /' s, is often
written f n{x).
190 > CHAPTER 21. FUNCTIONS
EXAMPLE 21-5 If f(x) = x + 2, then f ( x ) = (((((x + 2) + 2) + 2) + 2) + 2) + 2 = x + 12.
EXERCISE 21-12 Find f 2(x) if f(x) is
i. x/(x +1).
ii. \/x.
iii. x.
WARNING: The function f n(x) is NOT the same as the function [/(*)]”, which is the nth power of
/. Do not confuse the two. This is easier said than done, because some very confusing notation has
become popular, in which, for example, sin2 x is meant to mean (sin x)2. By what we have just said,
sin2 x should mean sin(sinx). The reason that sin2 x = (sinx)2 is that constructions like sin(sinx) are
very rare, while expressions like (sin x)2 are very common. Thus the simple notation sin2 x is used
for the latter rather than the former. Be careful.
EXAMPLE21-6 If f(x) = x2, then the function /3(x) is ((x2)2)2 = (x4)2 = x8, while the function [/(x)]3
is (x2)3 = x6.
Still another thing we can do with the output of a function is to put it through a different function.
If / is the first function and g the second, the outcome looks like g(f(x)). Of course, we again must
make sure that f(x) is in the domain of g, and so on. One notation to watch for is writing g(f(x)) as
g°f-
EXAMPLE 21-7 Suppose f(x) = 6x2 and g(x) = x/( \/x + 1). Then (g o f)(x) = 6x2/( V6x + 1).
EXERCISE 21-13 Find a counterexample to the "identity" / o g = g o f .
21.4 Even and Odd
Some functions have certain kinds of symmetry which make them easier to work with. One function
we looked at earlier was /(x) = x2, graphed in Example 21-2. If you look back at that graph, you will
see that it is symmetric about the y-axis.
EXERCISE 21-14 Show that symmetry of the graph of a function /(x) about the y-axis is equivalent
to f(x) satisfying the identity
/(x) = /(-*)• (21.2)
EXERCISE 21-15 W h a t ty p e o f sy m m etry h as th e g ra p h o f a fu n ctio n /(x) w h ich sa tisfies th e id en tity
the ART o f PROBLEM SOLVING < 191
Functions with symmetry about the y-axis, or, equivalently, which satisfy (21.2), are called even.
Similarly, functions which map to themselves when rotated 180° about the origin (those which
satisfy (21.3)) are called odd.
EXAMPLE 21-8 Consider a function which for x > 0 looks like the first picture below. If the
function is even, the continuation to x < 0 looks like the second picture. If the function is odd, the
continuation to x < 0 looks like the third picture.
EXERCISE 21-16 Draw some functions which are even, odd, and neither even nor odd.
EXERCISE 21-17 Write down some functions which are even, odd, and neither.
EXERCISE 21-18 Find which of the following are odd or even: x, x2, x3, x4, x6 + 27x4 + x2, x5 + 1,
x6 + x5?
EXERCISE 21-19 A function of the form anxn + fl„_ix”-1 H + ao, where n is a positive integer and
the a { s are constants, is called a polynomial. When is a polynomial even? Odd?
EXAMPLE 21-9 What are the possible values at x = 0 of even or odd functions?
Solution: If / is odd, then we have f( - x ) = -f(x ). Substituing in x = 0, we then have /(0) = -/(0),
so 2/(0) = 0 and /(0) = 0! On the other hand, if / is even, we merely get /(0) = /(0), and /(0) can be
anything at all. Hence an odd function must pass through the origin, but an even function has no
similar restriction.
21.5 Some Special Functions
There are certain functions which, while useful, don't fit in nicely with anything else. The only way
to study such functions is on a case-by-case basis.
21.5.1 Absolute Values
One very important such function is the absolute value function, denoted by /(x) = |x|. The function
returns the distance from x to 0, which is just the positive version of x: x itself if x is positive, -x if x
is negative. For example, |4| = 4, |17| = 17, |-3| = 3, |-9| = 9, and |0| = 0. Absolute value can also be
used to denote the distance between two numbers; for example, |x - y| < 2 means that x and y are
less than 2 units apart.
192 > CHAPTER 21. FUNCTIONS
EXERCISE 21-20 Make sure you understand why |x-y| < 2 means that x and y are less than 2 apart.
Why do we need an absolute value here?
EXERCISE 21-21 Graph the absolute value function f(x) = |x|. What are its domain and range?
When confronted with the absolute value sign in a problem, the easiest thing to do is usually to
replace the absolute value problem by a new problem without the absolute value. We use the fact
that if |M| = N for any expressions M and N, then either M = N or M = -N .
EXAMPLE 21-10 Find all solutions to the equation \x2 - 3x| = 4.
Solution: We can split the problem into two cases: either x2 - 3x = 4 or x2 - 3x = -4 . The
first case yields the solutions 4 and -1 ; the second yields (3 ± i V7)/2. If we restrict ourselves to real
solutions, only 4 and -1 are acceptable.
EXERCISE 21-22 Solve the equation |(x + 2)/(3x - 1)| = 5.
21.5.2 Floored
Another important special function is the greatest integer function or floor function, denoted by
f(x) = |xj or f(x) = [x]. The value of the function is just x itself if x is an integer, or the integer directly
below x if not. Thus [3] = 3, |4.3J = 4, [—7z] = -4 , and LV2/2J = 0. Because they nicely suggest what
the function does and are more distinctive, we prefer the LJ notation and the name "floor function."
EXERCISE 21-23 Find |_- Vl7J, L\Zl7J, L- VI7J, and LVV7\.
To plot the floor function is difficult, because it is the first function we have tried to plot which
is not continuous . A continuous function is one which can be drawn in one curve without picking
up the pen.
Suppose we try to draw the floor function in this way. Start from 0,
where the value is 0. Moving to the right, we stay at 0, since [0.1J = 0,
L0.2J = 0, etc. Thus the line will stay at f(x) = 0 through x = 0.9, 0.99,
0.999, closer and closer to 1. But as soon as we cross x = 1, the function
value jumps up to f(x) = 1; we have to pick up the pen. The graph ends up
looking like the figure at right. The open circles are to emphasize that the
points circled are not part of the graph; the closed circles emphasize that
the points circled are part of the graph.
the ART o f PROBLEM SOLVING < 193
EXERCISE 21-24 The function x - |_xj is called the fractional part of x, and is usually denoted with
curly braces: (x|. Find {17}, (—17/2}, {17/3}, {-17/4}, and {17/5}. Plot the function f(x) = (x|.
EXERCISE 21-25 The ceiling function [xl is defined as the smallest integer which is greater than
or equal to the input. Plot the floor and ceiling functions on the same set of axes. Where do the two
coincide?
EXERCISE 21-26 If /(x) = [xj and g(x) = fxl, express g(x) in terms of /(x) and x. Check that your
expression works by substituting in some numbers.
EXERCISE 21-27 Are the absolute value and floor functions even, odd, or neither?
EXERCISE 21-28 Prove the following for all real x.
i. |xj + l~x\ is equal to either 0 or -1 .
ii. |x + \\ is the integer nearest x.
iii. |xJ ~ 2Lx/2J is equal to either 0 or 1. (Hint: consider the decomposition |_xj = x - {x}.)
21.5.3 Split Up
Not all functions can be simply described by a single expression. Sometimes a function will behave
one way in one region and another way in another. For example, consider the absolute value function
/(x) = |x|. The function is really two functions: f(x) = x for positive x and /(x) = - x for negative
x. So instead of writing |x|, which would be confusing to someone who had not seen this special
shorthand, we could be explicit and write
t, \_ I *' if * - 0
{ -x , if x < 0
This structure clearly acknowledges that there are two cases involved, and that the function takes
a simple form for each case.
For the absolute value function this is a bit formal—most people know what the function is. For
other functions, however, this type of construction might be necessary. We might wish, for some
reason, to construct a function g(x) which is x2 in the region x > 3, x3 for -2 < x < 3, and x4 for
x < -2 . (Note the way the entire real line is covered by our cases.) Since there is no ready-made
notation for this function as there is for the absolute value, we could use the general case structure
to write
( x2, x > 3
g(x) = I x3, 3 > x > - 2
x4, - 2 > x
EXERCISE 21-29 H o w m a n y tim es d o es th e fu n ctio n
r x2 - 8, x > 3
g(x) = ^ x 3 + 9, 3 > x > - 2
I x4 - 15, - 2 > x
194 > CHAPTER 21. FUNCTIONS
in terse ct th e x -ax is?
21.6 Transforming a Function
Once you have a basic understanding of functions, you can begin to construct new functions from
functions you already have. There are four basic transformations which can be done.
EXAMPLE 21-11 The first basic transformation is to replace the old function /(x) with f(x + a), for
some number a. What does this do to the function? Let's try it for a simple function, like |jc|, and
take a = 2. We can plug in some values of x to see what is going on. The values of /(x) and f(x + 2)
for various x values can be easily arranged in a table, as below. Using these values, we can draw the
two graphs on one pair of axes.
X M |x + 2|
-5 5 3
-4 4 2
-3 3 1
-2 2 0
-1 1 1
0 0 2
1 1 3
2 2 4
3 3 5
4 4 6
5 5 7
In the table and the corresponding graph, we can clearly see that the graph of |x + 2| is just the
graph of |x| shifted toward the left by 2! Why is this? For each x, the value of f(x + 2) will equal
the value of f(x) for x + 2, which is the point 2 to the right of x. Hence f(x) is 2 units to the right of
/(x + 2). Thus the entire graph of |x + 2| must be a shifted version of the graph of |x|.
EXERCISE 21-30 Understand why f(x + 2) must be a shift of /(x), using the table for |x|if necessary.
Why should the shift be to the negative, even though 2 is ad d ed to x?
EXAMPLE 21-12 A second basic functional transformation is to add some number a outside the
function, taking /(x) to /(x) + a. Let's try this with f(x) = |x|.
Taking a = 2, we can quickly plot |x|and |x|+ 2 on the same graph, as
at right. Put in a few points yourself to confirm that these are the correct
graphs; for example, for x = -4 , |x| = 4 and |x|+ 2 = 6. From the graphs
we can immediately see that adding 2 to the function shifts the graph up
by 2. Can you see why this must be true?
EXAMPLE 21-13 Yet another transformation we can apply is multiplying the function /(x) by a
constant a, to get af(x).
the ART o f PROBLEM SOLVING < 195
2m As before, we take f(x ) = |x|and a = 2. Let's draw the graphs again.
The transformed graph this time is a vertical stretch by a factor of 2, as
shown. The distance from each point on f(x) to the x-axis is doubled
when we draw 2f(x), so 2f(x) is the result of the aforementioned stretch.
I I I I f-P r+ I I I I I
EXAMPLE 21-14 The last transformation we will consider is going from /(x) to f{ax).
At the right, we plot /(x) = |x|and f(2x) = |2x|; it is clear in this graph
that multiplying by 2 corresponds to a horizontal shrink by a factor of 2.
For example, let g(x) = /(2x), then note that g(l) = /(2), g(2) = f ( 4), etc.
Now do you see why f(2x) is a horizontal shrink of /(x)?
WARNING: Though the pictures resulting from 2|x| and \2x\ are the
same, a vertical stretch by 2 and a horizontal shrink by 2 are not generally
the same thing. For example, take g(x) - 2 yfx and h(x) = V2x; we have g(8) = 4 V2, but h(8) = 16.
EXERCISE 21-31 What relationship does the function /(x/2) have to the function /(*)?
EXERCISE 21-32 Shift and stretch some more functions to get comfortable with these techniques.
If necessary, you can always resort to plotting the functions on a point-by-point basis, though you
should soon be able to plot the transformed function without this. Always plot both the original
function and the transformed function, to make sure you understand what the transformation does.
Problems to Solve for Chapter 21
402. Which values of x must be excluded from the domain of
2
(MA© 1990)
403. If f(x) = 2x2 - 3x + 1, then find /(4x). (MA© 1990)
404. If f(x + 1) = x2 + 3x + 5, then find f(x). (MA© 1991)
405. If /(4x + 3) = 2x + 1, then find /(-9). (MA© 1987)
406. How many solutions are there to the equation \x2 - 6x\ = 9? (MA© 1991)
407. Let [x] denote the greatest integer function, and {x} = x - [x] the fractional part of x. If
{V3}2 - 2 { V 2 ) 2
{V 3)-2{V 2}'
196 > CHAPTER 21. FUNCTIONS
408. Let / be the function from real numbers to real numbers defined by:
f j x + 2, if 3 is a divisor of [x]
* ~ \ x - 1, otherwise
As usual, [x] stands for the greatest integer function. Compute / ( / ( / ( / ( / ( h ))))). (MA© 1992)
409. Solve for all real values of y: |3y + 7| = |2y - 1|. (M A TH C O U N TS 1990)
410. Find the area of the region determined by the system
y > M
y < —|x + 1| + 4.
(M A TH CO U N TS 1992)
411. Find the coordinates of the points of intersection of the graphs of the equations y = \2x\ - 2 and
y = -\2x\ + 2. (M A TH CO U N TS 1989)
412. Find the equation whose graph is as shown at the right.
(M A TH CO U N TS 1989)
413. Prove that L2xJ + |2yJ > |xj + LyJ + + yj for all real x and y.