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.
Fig.6. An illustration of what f g does to x. As shown, g first acts on the input x giving some output g(x). Next, f takes g(x) as input, and produces the output f(g(x)).
Example 2.22 We can express px2 +3x +1 as a composition of the square root function f(x)=px with the polynomial g(x)=x2 +3x +1. That is, we can write
f g(x)=f x2 +3x +1 = x2 +3x +1. ⇣ ⌘ p
Exercise 2.23 Let f,g be as in the example above. (a) What is the domain and range of f g(x)? (b) Compute the “opposite” composition g f(x).Whatisthedomainandrange now? (Use some graphing tool to verify that your answers make sense.) Exercise 2.24 Let f(x)=(1 x)/(1 + x). (a) Compute the composition f f. (b) What is the domain and range of f f? (c) Try to explain graphically why the formula for f f is the way it is? 2.1. SOME GENERAL PROPERTIES OF FUNCTIONS 113
Inverse functions
Now, we consider one last way of manipulating functions. Namely, inverting them.
Fig. 7. To the left, we see a visualisation of the square root function f(x)=px.To the right, we give an initial visualisation of its inverse function, which we usually 1 denote by f (x).
The point of the above figure is that we can think of the inverse function of some function f as having exactly the same graph, as long as we flip the roles of the axes. That is, we let the vertical axis play the role of the x-axis. 1 Here is another way of "visualising" what f does:
Fig. 8. The role of the inverse function is to do exactly the opposite of the original function. If the original function sends a value x to y. Then the inverse function is to send that y back to x (or vice versa).
1 Example 2.25 Let f(x)=px, and let f denote its inverse function. To find a 1 formula for f , we can do as follows. First, we flip the roles of the variables x and y, 1 so that we can write y = f (x). This means that we have to write f(y)=x.Tofind a formula for f 1, we need to solve for y. But since D = y 0 , we can do this by f(y) { } observing that: py = x y = x2. () 1 2 In other words, f (x)=x .
Here is (yet another) visual representation of what we did in the above example: 114 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS
Fig.9. First, we flipped the names of the x and y-axes (but without doing anything to the graph itself) to be able to write x = f(y). Next, we solved for y.Indoing this, we essentially "forced" the x and y-axes back to their usual positions (this time, twisting the graph in the process). After doing this, we observe that the inverse of y = px is the familiar graph of y = x2.
1 Exercise 2.26 Use the above procedure to determine f for the following functions. 2 1 x (a) f(x)=3x +2 (b) f(x)= (c) f(x)= . 3x 1 1+x Not every function can be inverted. Let us look at an example.
Example 2.27 Based on what we did above, this is perhaps surprising, but the function y = x2 cannot be inverted. To understand why, let us look at its graph:
Fig. 10. Here, we see the graph of y = x2 both unflipped (left) and flipped (right).
Note that the green arrows in Figure 10 do not define a function! Indeed, if we start out with the value x =4on the vertical axis, we have two – not one – candidate for a y-value on the horizontal axis. There is nothing telling us which one to choose! Moreover, we see that the flipped graph, which should be the graph of the inverse function, fails the vertical line criterion!
From the above example, we observe that if a functions fails to be invertible, this can be recognised by applying the vertical line criterion to its flipped graph. But this is exactly the same as applying the following to the original (unflipped) graph. 2.1. SOME GENERAL PROPERTIES OF FUNCTIONS 115
Remark 2.28 (Horizontal line criterion) A function f has an inverse if and only if every horizontal line intersects its graph at most once.
Functions that satisfy this criterion are sometimes called one-to-one (each y-value corresponds to only one x-value), injective (do not ask me why, but I think its French) and invertible (since it is exactly these functions that can be inverted). We now formulate a proper definition of what we mean by inverse functions.
Definition 2.29 (Inverse function) Let f(x) be a one-to-one function. Then its inverse function, which we denote by f 1(x), is defined for all x R by the relation 2 f 1 f (x)=y x = f(y). () 1 (Note that the symbol f (x) can also mean 1/f(x) which, in most cases, is not the same as the inverse function of f.)
Exercise 2.30 To make y = x2 invertible, we must reduce its domain to, say, [0, ) 1 or ( ,0]. Why? Also, determine the formula for the inverse in both latter cases. 1
D ,R D 1 ,R 1 Exercise 2.31 How are f f and f f related? (This can be seen both from the definition of the inverse and by what happens when you flip graphs.)
One useful class of functions that are one-to-one (i.e., satisfying the horizontal line cri- terion) are the monotonous functions. These are functions which are either growing on all of their domains, or decreasing on all of their domain.
Fig.11. Which one(s) is (are) monotonous? Exercise 2.32 (a) Which of the functions in Figure 11 are monotonous? (b) Formulate an algebraic definition of what it means that a function is strictly growing and strictly decreasing, respectively. (c) Formulate algebraically what it means to satisfy the horizontal line criterion.
Exercise 2.33 If f and g are inverse functions of eachother, what can you say about the compositions f g and g f? 116 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS
2.2 A closer look at some familiar functions
In this section, we consider more closely the translation identities of the trigonometric functions, and certain properties related to the absolute value function.
Translation identities for the trigonometric functions
In Chapter 0, we stated several translation identities of the trignometric functions. We now explain a bit closer how we can understand, and even prove them, We first give an example where we explain how they make sense visually.
Example 2.34 Suppose we want to understand, visually, why we have, for instance
(i) sin(x + ⇡/2) = cos x, (ii) sin(x + ⇡)= sin x and (iii) sin(⇡ x)=sin(x) Then one way is to consider the graphs as follows.
Fig. 12. We just place the y-axis at the point inserted into the sinus function when x =0, and then read graph in the direction indicated by the sign of x (towards to right if it is positive, and toward the left if it is negative). Notice that you yourself can invent a lot more translation formulas by using this appraoch.
Exercise 2.35 Use the above approach to determine formulas for
(i) cos(x + ⇡/2) (ii) cos(x + ⇡) (iii) cos(⇡ x)
Exercise 2.36 Combine the result of the above example and exercise to obtain for- mulas for
(i) tan(x + ⇡/2) (ii) tan(x + ⇡) (iii) tan(⇡ x)
The above approach is purely visual. To prove the translation results, we need to use the definition of the trigonometric functions. That is, we need to use the unit circle. We can either do this separately for each translation formula, or we can take a more general approach where we first prove the addition formulas for the trigonometric functions. 2.2. A CLOSER LOOK AT SOME FAMILIAR FUNCTIONS 117
Proposition 2.37 (Addition formulas) For all a,b R,wehave 2 sin(a + b)=sina cos b + cos a sin b
sin(a b)=sina cos b cos a sin b cos(a + b) = cos a cos b sin a sin b cos(a b) = cos a cos b +sina sin b
We indicate the proof of the formula for cos(a b) in Figure 13, where we use the notation P✓ = (cos ✓, sin ✓). The point is to use Pythagoras theorem to write an equa- tion saying that the distance from Pa to Pb is the same as the distance from Pa b to P0. When this formula is simplified, the addition formula appears. Fig.13. Part of the proof for the for- mula for cos(a b).
Exercise 2.38 In this exercise, we ask you to prove all the addition formulas.
(a) Use the above figure to prove the addition formula for cos(a b). (b) Use (a) to prove that cos(x ⇡/2) = sin(x). (c) Use (a) and (b) to prove the addition formula for sin(a b). (d) Use (a) and (c) to prove that the sine is odd and the cosine is even. (e) Use (d) in combination with (a) and (c) to prove the addition formulas for cos(a+ b) and sin(a + b).
Hint: In part (b), you also need to use the unit circle to figure out the values of sin(⇡/2) and cos(⇡/2).
Exercise 2.39 Use the addition formulas to prove the double angle formulas
sin 2x =2sinx cos x and cos 2x = cos2 x sin2 x.
Exercise 2.40 Combine the double angle formulas with the Pythagorean identity to prove the half angle formulas 1 cos 2x 1 + cos 2x sin2 x = and cos2 x = . 2 2 118 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS
Piece-wise defined functions and the absolute value function
We can combine two (or more) functions into a piece-wise defined function.
Example 2.41 Here is an example of a piece-wise defined function: x2 +3x +1 for x [ 2,0) f(x)= 2 px for x [0,2) ( 2 This means that on [ 2,0), function has the for- mula x2 +3x+1 while on [0,2) it has the formula px. Note that for x =0, the formula is given by px and not by x2 +3x +1. We indicate this on the graph by putting a filled in dot to indicate the y-value taken at x =0,andputahollow dot to indicate the y-value not taken. For simi- Fig. 14. The graph of the piecewise lar reasons, we put a filled dot at x = 2 and a defined function f(x). hollow dot at x =2.
Exercise 2.42 Suppose we change the definition of f above so that it reads
x2 +3x +1 for x [ 2,0] f(x)= 2 px for x [0,2) ( 2 Is this problematic?
The absolute value function is probably the sim- plest piece-wise defined function.
x if x 0 x = | | x if x<0 ( That is, for positive x, the absolute value func- tion is identical to y = x, and for negative x,it Fig.15. The graph of the absolute is identical to y = x. value function. As we mentoined in Chapter 0, the absolute value function is important because it is convenient to use when discussing distances. Indeed, naively, we would think of a b as the distance between two points a, b on the real line. However, does it make sense to have a negative distance? Well, in some cases, perhaps. But in general, we never say that the distance between, say, Malmö and Lund is negative 20 kilometers. For this reason, we often choose to let a b denote the distance between these points. More | | generally, whenever we want to talk about the "size" of something, the absolute value tends to be useful. 2.2. A CLOSER LOOK AT SOME FAMILIAR FUNCTIONS 119
Exercise 2.43 Just to let you test if you got the above paragraph, use the absolute value to compute the distance between (a) a =3and b =7, (b) a =3and b = 3. The absolute value function is closely connected to the modulus of complex numbers. Indeed, both the modulus of a complex number and the absolute value of a real number describe their distance to the origin. That is, for real numbers the absolute value is the same as the modulus. In particular, since the modulus of z = x +i0=x is px2 +0= px2 = x, this gives px2 = x , x R. | | 8 2 Exercise 2.44 Compute the left and right-hand sides of the above expression for x = 2 and x =2. Does the equality hold in both cases? Here are some computational rules that are true for the absolute value function.
Proposition 2.45 For all real numbers x,y we have: (i) xy = x y (ii) x/y = x / y . (iii) x + y x + y | | | || | | | | | | | | || | | | Moreover, for every R>0,itholdsthat
(iv) x