Chapter 2: Introduction to Functions
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 2 A closer look at functions In this chapter, we discuss functions in general, take a closer look at some of the functions introduced in chapter 0, and introduce some new ones. 2.1 Some general properties of functions Definition, domain and range of functions We begin by giving the following "informal" definition. Remark 2.1 (Informal definition of what we mean by a function) Let X and Y be two sets of points. Then a function from X to Y is any rule that to each x in X assigns a value y from Y . For most functions in these lecture notes, the sets X and Y will either be R or some subset of R. For instance, f(x)=x2 is a function from R to R. However, this function does not attain all values in R. The following definition gives us some vocabulary to discuss such properties. Definition 2.2 (domain, co-domain, range) The set X in the informal definition of a function is called the domain of f and is denoted by Df . The set of all values attained by f is denoted by Rf and is called the range of f. Finally, since we Fig. 1. Here, the green represents (almost) always require f to take real values, we the domain, the yellow the range, call R the co-domain of f. Notice that the range and the grey the co-domain. Note is often smaller than the co-domain. that we give X the name Df . 107 108 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS Let us now consider some example to illustrate what we mean by the above definition. But before we do this, we remark that if we do not state what we mean by the domain of a function, we always assume that Df is the largest domain for which the function makes sense. We call this the natural domain of the function. Example 2.3 The function f(x)=x2 +3x +1takes values in R for all x R,soits 2 natural domain Df is all of R. What about the range? Well, if we complete the square, we get f(x)=(x +3/2)2 5/4. Since the term (x +3/2)2 attains all values in [0, ), − 1 this means that f attains all values in [ 5/4, ). − 1 Exercise 2.4 Determine the ranges of the following functions. (a) f(x)=x2 +5x +6 (b) f(x)=x2 x 30 (c) f(x)=2x2 4x 4 − − − − Note that the range of a function depends on which domain we choose: Fig. 2. To the left, we see the graph of f(x)=px with domain D =[0, ).Tothe f 1 right, we see the graph of g(x)=px with domain Dg =[2,4]. Note that since the domains are different, then so are the ranges. Remark 2.5 The natural domain of f(x)=px is [0, ). However, this is assuming the 1 co-domain is R. If we instead choose the co-domain to be the set of complex numbers, then the natural domain of f(x)=px becomes all complex numbers. Exercise 2.6 Let ( 3/2,4] be the domain of x2 +3x +1. What is the range? − Exercise 2.7 Determine the natural domain of f(x)=px2 1+1.Whatisthe − corresponding range? 2.1. SOME GENERAL PROPERTIES OF FUNCTIONS 109 Remark 2.8 Determining the domain of a function is usually quite easy. You just look at the expression, and then note for which x it is defined or not. Determining the range is more difficult, and in general requires us to use the graph sketching techniques that we will develop in a later chapter. Let us now give a more formal definition of functions. This is not a definition we will really need, but we state it so that you have at least seen it. To keep things as simple as possible, we restrict the formulation to the case when X R and Y = R (which is true ⇢ for almost all functions that we meet in these lecture notes). Definition 2.9 Let X be a set of points from R. By a function from X to Y , we mean a subset G of (x,y):x, y R such that for each x X there corresponds at most one { 2 } 2 pair (x,y) G. 2 To shed some light on this definition, let us consider an example. Example 2.10 We consider f(x)=x2 +3x +1 as a function from R to R. Using the formula of f, we can compute as many values f(x) as we want. For instance, f(0) = 1,f(1) = 5. In particular, this means that (0,1) and (1,5) lie on the graph of f. And here is the point: the set (x,f(x)) : x R { 2 } is exactly what we mean by the graph of f. Notice that if we put y = f(x), then G is on the form (x,y):x R,y = f(x) .Inpar- { 2 } ticular, such a set satisfies Definition 2.9 with X = Y = R since to each x there exists at most one coordinate (x,y) G (in this case, for each 2 Fig. 3. The graph of f. x R there exists exactly one such coordinate). 2 While we will not be much concerned with the above definition, it does give some following insight. For instance, the following definition should make sense. Definition 2.11 Two functions f and g are equal if their graphs are equal. That is, if D = D and f(x)=g(x) for all x D = D . f g 2 f g 110 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS Exercise 2.12 Are the following pairs of functions equal? (a) f(x)=x2 1 and g(x)=(x 1)(x + 1) − − x2 1 (b) f(x)= − and g(x)=x +1 x 1 − (c) f(x)=e2lnsinx +e2lncosx and g(x)=1. Another piece of insight is the following. Since the definition of a function requires there to be exactly one pair (x,y) for each x X in the graph, we get the following 2 criterion for whether or not a curve (or any type of set, for that matter) in the plane is the graph of a function or not. Remark 2.13 (Vertical line criterion) A curve is the graph of a function f if (and only if) it intersects every vertical line in at most one point. Exercise 2.14 According to the vertical line criterion, which of the following graphs describe a function f(x)? Fig. 4. Although this exercise may seem slightly silly now, it will become important in what follows. Exercise 2.15 Does there exist a function f so that we can express the unit circle x2 + y2 =1:x,y R on the form (x,f(x)) : x [ 1,1] ? { 2 } { 2 − } Exercise 2.16 By looking back at Chapter 0, or using some other resource, fill out the below table. Function Naturaldomain Range ax2 + bx + c 1/x px ex ln x sin x cos x tan x 2.1. SOME GENERAL PROPERTIES OF FUNCTIONS 111 Even and odd functions Some functions have particularly nice symmetry properties. For instance, the function f(x)=x2 has the symmetry property f( x)=f(x) for all x while the function g(x)=x3 − has the property g( x)= g(x). − − Fig. 5. For f(x)=x2, the values at x and x are always the same, while for − g(x)=x3, the values at x and x are always the negative of one another. − These properties are so important they have been given special names: Definition 2.17 (Even and odd functions) Let f be a function defined on a domain D symmetric with respect to the origin (that is, x D x D ). f 2 f () − 2 f We call f even if f( x)=f(x) x D , − 8 2 f and we call f odd if f( x)= f(x) x D . − − 8 2 f Notice that all values of even and odd functions are always completely determined by their values on x 0. ≥ Exercise 2.18 (a) Suppose that f(x) is an odd function and let g(x)=x2.What can you say about the compositions f g and g f? Are they even, odd or neither? ◦ ◦ (b) Formulate (and prove) a proposition explaining what happens when you compose even and odd functions. Exercise 2.19 Suppose f is a function defined on all of R. (a) Check whether g(x)= (f(x)+f( x))/2 is even, odd or neither. (b) Use (a) as inspiration to show that you − can always write a function f as a sum of an odd and an even function. Exercise 2.20 For all functions in exercise 2.16, determine whether they are even, odd or neither. 112 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS Compositions of functions Quite often we allow functions to take functions as input. For instance, the functions sin(x2), ln(sin x) and px2 +3x +1are all what we call compositions. Definition 2.21 Let f,g be functions. Then the composition f g is defined by ◦ f g(x)=f g(x) , ◦ ⇣ ⌘ where Df g = x Dg such that g(x) Df . That is, the domain consists of all x Dg ◦ { 2 2 } 2 such that g(x) is in Df . Here is a standard diagram used to explain what the composition does.