First Year Calculus: Wwlchen
First Year Calculus: Wwlchen
W W L CHEN
c
W W L Chen, 1982, 2008.
This chapter originates from material used by the author at Imperial College, University of London, between 1981 and 1990. It is available free to all individuals, on the understanding that it is not to be used for nancial gain, and may be downloaded and/or photocopied, with or without permission from the author. However, this document may not be kept on any information storage and retrieval system without permission from the author, unless such system is not accessible to any individuals other than its owners.
Chapter 2
FUNCTIONS
2.1. Introduction Let us begin with two very simple examples which everybody can understand. Example 2.1.1. Consider a simple test where there are 4 questions each of which is marked 1 (correct) or 0 (incorrect), and a student is awarded a mark equal to the number of correct answers obtained. Now the possible results that a student can get are the following: 1111 1011 0111 0011 More formally, we may consider a set A = {1111, 1110, 1101, 1100, 1011, 1010, 1001, 1000, 0111, 0110, 0101, 0100, 0011, 0010, 0001, 0000} of all the possible markings, as well as a set B = {0, 1, 2, 3, 4} of the marks awarded. The rule is then given by a function f : A B, where f (1111) = 4, f (1011) = 3, f (0111) = 3, f (0011) = 2, f (1110) = 3, f (1010) = 2, f (0110) = 2, f (0010) = 1, f (1101) = 3, f (1001) = 2, f (0101) = 2, f (0001) = 1, f (1100) = 2, f (1000) = 1, f (0100) = 1, f (0000) = 0. 1110 1010 0110 0010 1101 1001 0101 0001 1100 1000 0100 0000
Example 2.1.2. The set of even natural numbers can be obtained by taking the set N of all natural numbers and multiplying each of them by 2. More precisely, we can considering a function f : N N, where f (x) = 2x for every x N.
Chapter 2 : Functions page 1 of 10
More formally, let A and B be sets. A function f from A to B assigns to each x A an element f (x) in B. We write f : A B : x f (x) or simply f : A B. The set A is called the domain of f , and the set B is called the codomain of f . The element f (x) is called the image of x under f . Furthermore, the set f (A) = {y B : y = f (x) for some x A} is called the range of f . Two functions f : A B and g : A B are said to be equal, denoted by f = g, if f (x) = g(x) for every x A. It is sometimes convenient to express a function f by its graph G. This is dened by G = {(x, f (x)) : x A} = {(x, y) : x A and y = f (x) B}. Example 2.1.3. Consider the function f : R R dened by f (x) = 2x for every x R. Then the domain and codomain of f are R, while the range of f is also R. Also, we have f (1) = 2 and f (2) = 4. Example 2.1.4. Consider the function f : N N dened by f (x) = 2x for every x N, as discusssed in Example 2.1.2. Then the domain and codomain of f are N, while the range of f is the set of all even natural numbers. Also, we have f (1) = 2, while it is inappropriate to discuss f (2), since 2 does not belong to the domain of the function. Example 2.1.5. Consider the function f : R R dened by f (x) = x2 for every x R. Then the domain and codomain of f are R, while the range of f is the set of all non-negative real numbers. Example 2.1.6. Denote by S the set of all non-negative real numbers. Consider the function f : R S dened by f (x) = x2 for every x R. Then the domain of f is R, the codomain of f is S, while the range of f is also S. The functions in Examples 2.1.5 and 2.1.6 are dierent, although they share the same dening formula and domain. In Example 2.1.6, we have, by our careful choice of the codomain, ensured that the range is the whole of the codomain. This is a very important point in the denition of a function. The choice of domain and codomain is entirely at our disposal. Sometimes, we make our choice to suit our precise needs. Example 2.1.7. In the previous four examples, the functions have dening formulas. However, this need not necessarily be the case. Suppose that A = {1, 2} and B = {a, b, c}. Then we can dene a function f : A B simply by writing, for example, f (1) = a and f (2) = c. Example 2.1.8. The speed of light is denoted by c. It follows that the distance travelled by light in time t is given by the formula f (t) = ct. This can formally be made a function, but we must be careful with our domain to ensure that t is non-negative. An appropriate choice for the domain may be the set S of all non-negative real numbers, in which case an appropriate choice for the codomain will be S again. Strictly speaking, we may also choose our codomain to be R or any set that contains S, although these choices are in some sense not natural, since distance is represented by a non-negative real number. Example 2.1.9. Suppose that we wish to study the temperature on a metal disc of radius 1 metre. Then it is convenient to represent each point on the disc in polar coordinates r and , where 0 r 1 and 0 < 2. In this case, we may take the domain A = [0, 1] [0, 2), and consider a function f : A B, where B is a suitable range of real numbers sucient to represent all possible temperature of the metal disc. For instance, we may take B = R. Example 2.1.10. Suppose that the air resistence that an object encounters is proportional to the speed of the object. Then the resistence may be given by r = kv, where v represents the speed of the object and k is a positive proportionality constant. The domain must be a set of the form [0, V ], where V is a suitably chosen number not exceeding the speed of light. The codomain may be an interval of the form [0, R], where R kV . Then we have a function f : [0, V ] [0, R], where f (v) = kv for every v [0, V ].
Chapter 2 : Functions page 2 of 10
2.2. Composition of Functions We begin by discussing a practical problem in which functions play an important role. Example 2.2.1. Consider the problem of producing a map of the world to show the altitude of land and the depth of sea, and let us simplify our problem by assuming that no land is below sea level. We may rst represent the altitude of land by a non-negative real number and the depth of sea by a negative real number. Now the position of any point on earth can be represented by two numbers (x, y), where x is the degree in longitude and y is the degree in latitude, with the convention that east and north are positive and west and south are negative. Then (x, y) [180, 180] [90, 90], and we can represent the altitude or depth at the point (x, y) by a real number which we denote by h(x, y). More formally, we take the domain P = [180, 180] [90, 90] and consider a function h : P R, where for every (x, y) P, the value h(x, y) represents the altitude or depth of the earth at the point (x, y). Next, we may use some colour to denote the ranges of altitude and depth. For instance, we may choose the following scheme: dbr: lbr: yll: grn: wht: lbl: mbl: dbl: dark brown, representing altitude of 5000 metres or higher light brown, representing altitude of 3000 metres or higher, but below 5000 metres yellow, representing altitude of 1000 metres or higher, but below 3000 metres green, representing altitude below 1000 metres white, representing depth of under 1000 metres light blue, representing depth of 1000 metres or more, but under 3000 metres medium blue, representing depth of 3000 metres or more, but under 5000 metres dark blue, representing depth of 5000 metres or more
More formally, we take a codomain C = {dbl, mbl, lbl, wht, grn, yll, lbr, dbr}, and consider a function s : R C, where for every x R, we have dbl if x 5000, mbl if 5000 < x 3000, lbl if 3000 < x 1000, wht if 1000 < x 0, s(x) = grn if 0 x < 1000, yll if 1000 x < 3000, lbr if 3000 x < 5000, dbr if x 5000. To produce a map, we now need to associate position of any point on earth with the colour that represents its altitude of depth. We need to nd some way to combine these two functions that we have constructed. Suppose that A, B and C are sets and f : A B and g : B C are functions. We dene the composition function g f : A C by writing (g f )(x) = g(f (x)) for every x A. Put simply, for every x A, in order to nd (g f )(x), we apply the function f rst to x, followed by the function g to f (x). The picture x describes this composition. Example 2.2.2. Continuing with Example 2.2.1, recall that we have two function h : P R and s : R C. The rst of these give the altitude or depth of points on earth, while the second one gives colours corresponding to ranges of these altitudes and depths. To produce a map, we need to consider the composition s h : P C, given by (s h)(x, y) = s((h(x, y)) for every (x, y) P. The picture (x, y)
h
f (x)
h(x, y)
describes this composition. The rst arrow gives the altitude or depth, the second assigns the colour.
Chapter 2 : Functions page 3 of 10
Example 2.2.3. Suppose that the functions f : R R and g : R R are dened by f (x) = x2 and g(x) = x 1 for every x R. Then (g f )(x) = g(f (x)) = g(x2 ) = x2 1. (1)
Here there is a slight unease with the notation. It will be a little clearer if we think of the question as follows. Clearly we can say that the function g : R R is dened by g(y) = y 1 for every y R. After all, x and y are dummy variables which we simply use to represent arbitrary elements of R. Then as before, we have (g f )(x) = g(f (x)) = g(x2 ). Now write y = f (x) = x2 , so that g(x2 ) = g(y) = y 1 = x2 1. Clearly (1) follows from (2) and (3). Example 2.2.4. Next, let us consider the composition f g, where f and g are as in Example 2.2.3. We have (f g)(x) = f (g(x)) = f (x 1) = (x 1)2 . Note that (x 1)2 = x2 1 if and only if x = 1. This simple example shows that (g f )(x) = (f g)(x) does not hold in general. Example 2.2.5. Suppose that the functions f : R R, g : R R and h : R R are dened by f (x) = x2 , g(x) = x 1 and h(x) = x3 + 3x for every x R. Let us consider the composition h (g f ). Here it is convenient to think of the functions g : R R and h : R R as dened by g(y) = y 1 for every y R and h(z) = z 3 + 3z for every z R. To study h (g f ), we rst study g f . Then (g f )(x) = x2 1 as before, so that (h (g f ))(x) = h((g f )(x)) = h(x2 1). Now write z = (g f )(x) = x2 1, so that h(x2 1) = h(z) = z 3 + 3z = (x2 1)3 + 3(x2 1). On combining (4) and (5), we obtain (h (g f ))(x) = (x2 1)3 + 3(x2 1). Next, let us consider the composition (h g) f . To do so, we rst study h g. Clearly (h g)(y) = h(g(y)) = h(y 1). Now write z = g(y) = y 1, so that h(y 1) = h(z) = z 3 + 3z = (y 1)3 + 3(y 1). On combining (7) and (8), we obtain (h g)(y) = (y 1)3 + 3(y 1). However, ((h g) f )(x) = (h g)(f (x)) = (h g)(x2 ).
Chapter 2 : Functions
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
page 4 of 10
Now write y = f (x) = x2 . In view of (9), we have (h g)(x2 ) = (h g)(y) = (y 1)3 + 3(y 1) = (x2 1)3 + 3(x2 1). Combining (10) and (11), we have ((h g) f )(x) = (x2 1)3 + 3(x2 1). Note that the right hand sides of (6) and (12) are identical. In fact, the above is an example of the following rule. ASSOCIATIVE LAW. Suppose that A, B, C and D are sets, and that f : A B, g : B C and h : C D are functions. Then h (g f ) = (h g) f . It follows that no matter whether we are considering h (g f ) or (h g) f , the answer is the same. On the other hand, we clearly have (h (g f ))(x) = h((g f )(x)) = h(g(f (x))). The picture x describes this composition.
f
(11)
(12)
f (x)
g(f (x))
2.3. Real Valued Functions We are primarily interested in real valued functions. In other words, we take the codomain to be the set R of all real numbers. Suppose now that some dening formula is given. We may then ask how large we can make the domain. We illustrate this point by a number of examples. Example 2.3.1. We wish to nd the largest set D of real numbers such that f : D R, dened by f (x) = x for every x D, is a function. Then for x to be real valued, we must make sure that x 0. However, as long as x 0, and as long as we specify which square root we take, then the function is clearly dened. In this case, we can therefore take D to be the set of all non-negative real numbers. Example 2.3.2. We wish to nd the largest set D of real numbers such that f : D R, dened by f (x) = x2 + x for every x D, is a function. Then for x2 + x to be real valued, we must make sure that x2 + x = x(x + 1) 0; in other words, we must have x 0 or x 1. However, as long as x 0 or x 1, and as long as we specify which square root we take, then the function is clearly dened. In this case, we can therefore take D = {x R : x 0 or x 1}. Example 2.3.3. We wish to nd the largest set D of real numbers such that f : D R, dened by f (x) = (x2 4)1 for every x D, is a function. Then for (x2 4)1 to be real valued, we must make sure that x2 4 = 0. However, as long as x2 4 = 0, then the function is clearly dened. In this case, we can therefore take D = {x R : x = 2}. Example 2.3.4. We wish to nd the largest set D of real numbers such that f : D R, dened by f (x) = (x2 4)1/2 for every x D, is a function. Then for (x2 4)1 to be real valued, we must make sure that x2 4 = 0 (to ensure that we do not divide by 0) and x2 4 0 (to ensure that the square root is real). In other words, we must make sure that x2 4 > 0. However, as long as x2 4 > 0, and as long as we specify which square root we take, then the function is clearly dened. In this case, we can therefore take D = {x R : |x| > 2}.
Chapter 2 : Functions page 5 of 10
We can in fact vary the question somewhat. Example 2.3.5. Consider the set N = {1, 2, 3, . . .} of all natural numbers. We wish to nd the largest set D of real numbers such that f : D N, dened by f (x) = x 1 for every x D, is a function. Then for x 1 to be a natural number, we must make sure that x is a natural number at least 2. However, as long as x 2, then the function is clearly dened. In this case, we can therefore take D = {2, 3, 4, . . .}. In Chapters 3 and 68, we shall adopt the following convention. All functions will have codomain R; in other words, all functions are of the from f : D R. Furthermore, the domain D is a set of real numbers and, unless specied, is chosen to be the largest such set so that f : D R is a function.
2.4. One-to-One and Onto Functions Recall a very important point in our denition of a function. The choice of domain and codomain is entirely at our disposal. In this section, we shall show how we can make our choices to suit our precise needs. However, we need two denitions. Definition. A function f : A B is said to be one-to-one if x1 = x2 whenever f (x1 ) = f (x2 ). Definition. A function f : A B is said to be onto if for every y B, we can nd x A such that f (x) = y. The denitions can be more easily understood if we note the following. A function f : A B is one-to-one if no two dierent elements in the domain can share the same image. A function f : A B is onto if every element in the codomain is the image of some element in the domain; in other words, if the range is the same as the codomain. Example 2.4.1. The function f : R R, dened by f (x) = 2x for every x R, is one-to-one and onto. Example 2.4.2. The function f : N N, dened by f (x) = 2x for every x N, is one-to-one but not onto. Example 2.4.3. The function f : R R, dened by f (x) = x2 for every x R, is neither one-to-one nor onto. Example 2.4.4. Denote by S the set of all non-negative real numbers. Then the function f : R S, dened by f (x) = x2 for every x R, is onto but not one-to-one. Suppose now that the function f : A B is one-to-one and onto. Let y B. Since f is onto, we can nd some x A such that f (x) = y. Since f is one-to-one, there cannot be more than one such x A, for otherwise they would share the same image y. It follows that there is exactly one x A such that f (x) = y. This means that we can dene a function g : B A, with domain B and codomain A and such that g(y) = x precisely when f (x) = y. Such a function g : B A is called the inverse function of the function f : A B. It is not dicult to see that g : B A is also one-to-one and onto. We have proved the following result. PROPOSITION 2A. Suppose that A and B are sets. If the function f : A B is one-to-one and onto, then there exists a function g : B A such that g(y) = x whenever f (x) = y. Furthermore, the function g : B A is one-to-one and onto. Example 2.4.5. Recall that the function f : R R, dened by f (x) = 2x for every x R, is one-to-one and onto. Clearly the inverse function g : R R is dened by g(y) = y/2 for every y R.
Chapter 2 : Functions page 6 of 10
Example 2.4.6. Consider the function f : R R+ , where f (x) = x2 for every x R . Here R denotes the set of all negative real numbers, and R+ denotes the set of all positive real numbers. It is not dicult to see that the function is one-to-one and onto. Also, the inverse function is given by g : R+ R , where g(y) = y for every y R+ . Example 2.4.7. Consider the function f : N N, given by f (x) = x + 1 if x is odd, x 1 if x is even.
Note that f (1) = 2, f (3) = 4, f (5) = 6, . . . and f (2) = 1, f (4) = 3, f (6) = 5, . . . . Hence f is one-to-one and onto. Try also to convince yourself that f is its own inverse.
2.5. One-to-One and Onto Real Valued Functions By Proposition 2A, a given function f : A B has an inverse if it is one-to-one and onto. We consider now the case of real valued functions f : I R, where I is an interval on the real line. Our task is to nd sucient conditions for f to be one-to-one and onto, so that it has an inverse. Definition. (1) By an open interval in R, we mean a set of the form (A, B) = {x R : A < x < B}. (2) By a closed interval in R, we mean a set of the form [A, B] = {x R : A x B}. Remarks. (1) The interval (A, B] = {x R : A < x B} is open on the left and closed on the right, while the interval [A, B) = {x R : A x < B} is closed on the left and open on the right. (2) The denition is extended to A = and B = , provided that the interval is open at that end. Hence we consider intervals of the form (, B), (, B], (A, ), [A, ) and (, ). The last one is simply R. Definition. (1) A function f is said to be strictly increasing in an interval I if f (x1 ) < f (x2 ) for every x1 , x2 I satisfying x1 < x2 . (2) A function f is said to be strictly decreasing in an interval I if f (x1 ) > f (x2 ) for every x1 , x2 I satisfying x1 < x2 . Example 2.5.1. The function f (x) = sin x is strictly increasing in the closed interval [/2, /2]. Example 2.5.2. The function f (x) = x3 is strictly decreasing in any interval. To see this, suppose that x1 < x2 . Then f (x1 ) f (x2 ) = x3 x3 = (x2 x1 )(x2 + x1 x2 + x2 ) 2 1 1 2
1 1 = (x2 x1 )( 2 x2 + 1 x2 + 2 (x2 + 2x1 x2 + x2 )) 1 1 2 2 2 1 = 2 (x2 x1 )(x2 + x2 + (x1 + x2 )2 ) > 0. 1 2
PROPOSITION 2B. Suppose that I is an interval in R. Suppose further that the function f : I R is strictly increasing or strictly decreasing. Then f : I R is one-to-one. Proof. Since f (x1 ) < f (x2 ) or f (x1 ) > f (x2 ) whenever x1 = x2 , we must have f (x1 ) = f (x2 ) whenever x1 = x2 . However, we still need to have the onto property. This is obtained by choosing the codomain suitably. We have the following result.
Chapter 2 : Functions page 7 of 10
PROPOSITION 2C. Suppose that I is an interval in R. Suppose further that the function f : I T is strictly increasing or strictly decreasing, and that T = f (I). Then f : I T is one-to-one and onto, and there exists a function g : T I such that g(y) = x whenever f (x) = y. Furthermore, the function g : T I is one-to-one and onto. Proof. Note that the condition T = f (I) implies that the function f : I T is onto. The result now follows from Propositions 2A and 2B. Example 2.5.3. The function f (x) = x2 is strictly increasing in the interval [0, 2). Furthermore, we have f ([0, 2)) = [0, 4). It follows from Proposition 2C that f : [0, 2) [0, 4) has an inverse function. This is given by the function g : [0, 4) [0, 2), where g(y) = y for every y [0, 4). On the other hand, the function f (x) = x2 is strictly decreasing in the interval (2, 0]. In this case, we have f ((2, 0]) = [0, 4). It follows from Proposition 2C that f : (2, 0] [0, 4) has an inverse function. This is now given by the function g : [0, 4) (2, 0], where g(y) = y for every y [0, 4). Finally, consider the function f (x) = x2 in the interval (2, 2). We have f ((2, 2)) = [0, 4), but there is no inverse function g : [0, 4) (2, 2). Clearly the function f : (2, 2) [0, 4) is neither strictly increasing nor strictly decreasing in the interval (2, 2), so Proposition 2C does not apply in this case. Remark. In the statements of Propositions 2B and 2C, it is not necessary for the domain of the function to be an interval I. However, we then need to extend the notion of a strictly increasing or strictly decreasing function to functions of the form f : D R, where D is any non empty set of real numbers.
Chapter 2 : Functions
page 8 of 10
2. Consider the functions f : R R, g : R R and h : R R, dened by f (x) = sin x, g(x) = x and h(x) = x2 + 1 for every x R. a) What is g f ? b) What is f g? c) Show that (g f )(0) = (f g)(0). d) What is h (g f )? 3. Given f (x) = sin x, g(x) = x2 + 1 and h(x) = 3x + x, nd each of the following composite functions: a) f g b) f h c) g f d) g h e) h f f) h g g) f f h) g g i) h h j) f g h k) g h f l) h f g 4. Given f (x) = cos x and g(x) = x2 x + 1, nd each of the following composite functions: a) f g b) f f c) g g d) g f 5. For each of the following, determine the largest set D of real numbers for which f : D R is a function: a) f (x) = (x3 + 1)1 b) f (x) = tan x c) f (x) = sin x + tan x 1 e) f (x) = 5 x + x+1 d) f (x) = 1 1 x
f) f (x) = loge (1 x2 )
6. Find the largest possible domain and corresponding range for each of the following functions as a real valued function: x+1 a) f (x) = x2 4x + 3 b) f (x) = 4 x2 c) f (x) = x2 1 d) f (x) = |x + 2| 1 e) f (x) = x + 1 f) g(x) = x x 3 g) f (x) = e h) g(x) = x + 1 7. Sketch the following curves: a) f (x) = x + 4 d) f (x) = cos 2x 1 g) f (x) = 2 x +1
Chapter 2 : Functions
page 9 of 10
8. For each of the following functions f , draw a graph of the function with the given domain D, determine whether with a suitable choice of codomain T , which you must specify, the function f : D T has an inverse function and, if so, nd the inverse function: a) f (x) = 1 + 2x; D = (4, 7] b) f (x) = sin x; D = [0, ] c) f (x) = cos x; D = [0, ] d) f (x) = x2 2x + 4; D = [1, 2] e) f (x) = 2x + 4; D = [0, 2] x2 f) f (x) = 1 x2 ; D = (1, 1) g) f (x) = 1 x2 ; D = (0, 1)
Chapter 2 : Functions
page 10 of 10