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 , 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 , 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 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 function f(x)=px with the 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 , and certain properties related to the 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 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 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 . 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 and the absolute value of a 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

Fig. 16. Rule (iii), which is also known as the triangle inequality, will be especially important for us. It says that the combined length of the red lines is always longer than the length of the blue line. Since the absolute value function is defined in terms of two cases, it should not come as a surprise that to prove the above rules can be proven using the strategy proof by cases.

Example 2.46 (Proof of rule (i)) We do a proof by cases. First, suppose that both x 0 and y 0. This implies xy 0,andsowehave x = x, y = y and xy = xy. | | | | | | We may therefore conclude that in this case xy = x y . We ask you to check the | | | || | remaining cases in the exercises below.

Exercise 2.47 (a) Finish the proof in the above example, and (b) prove part (ii) of Proposition 2.45 by splitting into the same cases. Exercise 2.48 Let R 0. Use two cases to prove that x R R x R. | | ()   Exercise 2.49 By splitting into as many cases as you need, prove the triangle in- equality. (Hint: Use Figure 2.16, above, for inspiration.) 120 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS

Acloserlookatthelogarithmandaninequality

In Chapter 0, we did what most high school textbooks do. First define the exponential function as a power of the Euler number e=2.718281828459045..., and then define the as its inverse function. If we want to be more careful about the theory, it turns out that it is much more convenient to work the other way – and it is historically more correct. The exponential function became important only when differentiation caught on about 70-80 years later (more on this in a later chapter). The logarithm was essentially invented (or discovered?) by John Napier in 1614. The ba- sic idea was to find an invertible function that transforms into addition. That is, suppose you have two large numbers a and b, and you don’t really have the time or energy to compute a b. What can you do? Well, suppose · you have an invertible function f that does the following: f(a b)=f(a)+f(b). (2.1) · Moreover, suppose that you have a good table of values for f. Then you can compute the sum Fig.17. John Napier (1550 – 1617). y = f(a)+f(b). Find this value in your table, 1 and write down the corresponding value of f (y). This value should give you an ap- proximation of the product a b without having to perform the multiplication. ·

Fig. 18. Here we see a slide ruler. It is basically a clever table of values for the logarithm. Every physicist, engineer, maths teacher and maths student had one until the mid 70’s, when pocket calculators became widely available.

Example 2.50 Suppose a pre-mid 70’s engineer needed to compute the product, say, 1.703 3.689. Using his table of (or, more likely, his trusty slide rule), he · could see that ln(1.703) 0.53 and ln(3.689) 1.31 (usually, the slide rules allowed ⇡ ⇡ you to see between 2 and 3 significant digits). Next, the addition 0.52 + 1.31 = 1.83 is easily performed mentally. After this, the table of logarithms (or slide rule) is again consulted (but this time backwards) to see that ln(6.23) 1.83. That is, we conclude ⇡ that 1.703 3.689 6.23, which is pretty close to the more accurate value 6.282367... (in · ⇡ practice, this was as usually as accurate as anyone needed to get). 2.2. A CLOSER LOOK AT SOME FAMILIAR FUNCTIONS 121

So, how would you define the logarithm from scratch? Well, as it turns out, geomet- rically as a certain area under a curve.

Definition 2.51 (The natural logarithm) For x>0 we define

Ax if 1 x ln x =  A if 0

Warning: In these lecture notes, and for most mathematicians, the symbols ln(x) and log(x) mean exactly the same thing, and we will use both notations freely. Every property for the logarithm (including its computational rules) can be deduced from the above definition. However, at the moment, we only discuss the following prop- erties (and delay the others until we discuss derivatives).

Proposition 2.52 The natural domain of ln(x) is x>0,and x 1 (i) ln(1) = 0 and (ii) ln(x) x 1. x  

Exercise 2.53 (a) Use Definition 2.51 to ex- plain why it makes sense that ln(1) = 0. (b) Approximate the value of ln(x) using a rect- angle as shown in the figure to the right. Use this to obtain the inequality in property (ii), Fig. 19. A naive approximation of above. ln(x) using one rectangle. (c) Modify your argument in (b) to obtain the lower inequality for ln x. Exercise 2.54 By approximating the area defin- ing ln(2) by one, two and three rectangles, respec- tively, we can obtain approximations for ln(2) of better and better quality. Do compute these three approximations by hand and compare with the ac- tual value of ln(2). Fig.20. A slightly less naive ap- proximation of ln(2) using two rectangles. 122 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS

2.3 Some new functions

In this section, we consider the inverse trigonometric functions and the complex expo- nential function.

Inverse trigonometric functions We now consider the inverse functions of sin x, cos x and tan x (called arcsin x, arccos x and arctan x, respectively). There is just one problem, a quick glance at the graphs of the trigonometric functions reveals that they all fail the horisontal line test miserably! To get a deeper understanding of what is going on, let us recall how we defined the sine function using the unit circle.

Fig. 21. To the left, we recall that the sine function returns the “height” of the radial line as shown in the figure. To the right, we try to “flip” things, and illustrate how the inverse of the sine function should behave, namely, take the height as input and return the corresponding angle as output. However, for a given height x, there are at least two angles corresponding to it (in fact, there are infinitely many such angles).

To fix this, we need to change the definition of the sine function so that each height is paired with exactly one angle. This is done as follows.

Fig. 22. Left: We remove half of the unit circle, in the sense that we only keep angles between ⇡/2 and ⇡/2 degrees. In this way, to every height, there is exactly one angle. Right: This corresponds to restricting the domain of sin x to the interval [ ⇡/2,⇡/2]. As we see, restricted to this interval, the sine function satisfies the horisontal line criterion, and it can therefore be inverted. 2.3. SOME NEW FUNCTIONS 123

What we have done is to reduce the domain of the sine function. This leaves us with a restriction of the sine function called the principal sine function and which is denoted Sin x.

Fig. 23. Here are the graphs of the inverse trigonometric functions, also known as the arcus-functions. Compare the ranges and domains with those of the princi- pal trigonometric functions. Also note that the vertical asymptotes of the tangent became horizontal asymptotes for the arctangent.

Exercise 2.55 How should we restrict the domains of cos x and tan x in order to obtain the inverse functions shown in Figure 23?

We note that the restricted versions of cos x and tan x obtained in the above exercise are denoted Cos x and Tan x, respectively, and are called the principal cosine and tangent functions. Since these pass the horisontal line test, we can invert them to obtain the functions arccos x and arctan x whose graphs are shown in Figure 23.

Exercise 2.56 What values for the inverse trigonometric functions does Table 0.14 give? Exercise 2.57 What do you expect the graph of arcsin(sin x) to look like? Draw the graph in some graphing tool. Are you surprised? Can you explain what is going on? Exercise 2.58 By looking Figure 23, do any of the inverse trigonometric functions appear to be even or odd? Prove your suspicions.

When computing expressions involving both trigonometric and inverse trigonometric functions, there are at least two strategies that may prove useful: (1) try to use geometric reasoning on the unit circle, and (2) try to reason using trigonometric formulas. Here is an example of what we mean:

Example 2.59 Let us show that cos(arcsin(x)) = p1 x2 using the two approaches mentioned above: 124 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS

Method 1: We use a geometric argument on the unit circle. By definition, the arcsine takes a number x [ 1,1] and as output produces an angle ✓ = arcsin(x) 2 2 [ ⇡/2,⇡/2] so that sin ✓ = x. This is illustrated in the following figure:

Fig.24. If the height of the straight triangle is x, then the angle is arcsin(x).Note that by definition, arcsin(x) is always between ⇡/2 and ⇡/2. Our goal is to compute cos ✓. But by Pythagoras to the straight triangle in the above figure, we immediately see that this is equal to p1 x2, and we are done. Method 2: We now turn to the second method, and try to compute cos(arcsin(x)) by using trigonometric formulas. The main idea is now to use that, by definition, sin(arcsin x)=x. To this end, we need some formula connecting sin x and cos x.One such formula is the Pythagorean, which we can express as cos2 x =1 sin2 x. Replacing x by arcsin x,weobtain cos(arcsin x)2 =1 x2. Taking the square root on both sides gives

cos(arcsin x)= 1 x2 or cos(arcsin x)= 1 x2. p p Finally, we observe the following: arcsin(x) only takes values in [ ⇡/2,⇡/2]. But for these values, the cosine is always positive. And so, we can conclude that

cos(arcsin x)= 1 x2, p and we are done!

Exercise 2.60 Using exactly the same figure as in the above example, also compute tan(arcsin x). Exercise 2.61 Using the ideas of the above example, compute sin(arccos x). Exercise 2.62 (a) Show that 1/ cos2(x) = 1+tan2(x). (b) Compute cos(arctan(x)). 2.3. SOME NEW FUNCTIONS 125

The complex exponential function and complex n’th roots

Before discussing the complex exponential function, let us take a moment and take a closer look at the complex numbers. To this end, we need to introduce one additional axiom.

Axiom 2.63 (Imaginary unit) There exists a number i, called the imaginary unit, satisfying the axioms for the addition and multiplication of real numbers from part 1 of the rulebook for R, and which is such that

i2 = 1. We also call this number the square root of 1 and sometimes denote it by p 1. Given this axiom, we define the complex numbers as follows:

Definition 2.64 (Complex numbers)

C = a +ib : a,b R . { 2 }

Exercise 2.65 Use the rule i2 = 1 to expand (a +ib)2. In Chapter 0, we introduced the and the modulus. Here, we recall their computational rules and ask you to prove them.

Proposition 2.66 For complex numbers z and w we have: z z¯ (i) z + w =¯z +¯w (ii) z w =¯z w¯ (iii) = · · w w¯ ⇣z ⌘ z (iv) z + w z + w (v) z w = z w (vi) = | | | || | | | | · | | |·| | w w | | Exercise 2.67 The rules in the above proposition can be verified by writing z = a+ib and w = u +iv and then comparing what we get on the left and right-hand sides, respectively. Do this for rules (ii) and (v). Exercise 2.68 The most “important” of the above rules is perhaps (iv), which is called the triangle inequality. (a) Represent graphically what this inequality says (the point is to think of complex numbers as vectors, and the modulus as distance). (b) Prove the triangle inequality for complex numbers. Hint: One way to start this proof is by squaring both sides, and then use that z 2 = a2 + b2. | | 126 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS

We now take a look at how the trigonometric functions help us express complex numbers in a useful way. As we see on the figure to the right, not only can a z be expressed in terms of its real and imaginary parts (that is, on the Cartesian form z = a +ib), but also in terms of its modulus r and argument ✓ (see figure to the right). Fig. 25. Notice how r Definition 2.69 (Argument) The angle ✓ which the and ✓ completely determine line segment from the origin to a complex number z where z lies in the com- makes with the origin is called the argument of z.We plex plane. Moreover, no- call the unique argument between [0,2⇡) the principal tice that if ✓ is an argument argument of z and denote it by Arg z. of z then so is ✓ +2⇡k for all k Z. 2

Exercise 2.70 Use what you know about to show that a complex num- ber with modulus r and angle ✓ can be expressed as z = r(cos ✓ +isin✓).

Hint: This was explained in Chapter 0.

We now define the complex exponential.

Definition 2.71 (Complex exponential) For all ✓ R, we define 2 ei✓ = cos ✓ +isin✓.

Notice that, by using this definition, the polar representation of a complex number can be ex- Fig. 26. That is, given some ✓ R, 2 pressed by then ei✓ is just a shorter way of writ- i✓ z = re . ing out the complex number cos ✓ + In other words, the job of the complex exponen- isin✓, which in turn is just the coor- tial is to express the angle of a complex number. dinate (cos ✓, sin ✓) on the unit circle.

Notice that the above definition just assigns the symbol ei✓ to the complex number cos ✓ +isin✓? This means that at this point, we have now reason to believe that the complex exponential has anything to do with Euler’s number e=2.718....Still,aswe will see in the very last chapter of these lecture notes, there is a connection. However, here, we will only catch a glimpse of this connection ei✓ by proving that in some ways, the complex exponential acts like an exponential function. Indeed, this is the contents of the following proposition (that we investigate in the exercises): 2.3. SOME NEW FUNCTIONS 127

Proposition 2.72 (computational rules) For angles ✓, R and n Z: 2 2 i0 i✓ 1 (i) e =1 (iii) e = ei✓ (ii) ei(✓+) =ei✓ ei (iv) (ei✓)n =ein✓. ·

Note that in rule (iv), we avoid taking roots. Since we need to be careful when discussing roots of complex numbers, we will discuss this separately further below. Let us now consider how to prove these rules. As an example, we prove rule (iii).

Example 2.73 (Proof of Proposition 2.72(iii)) We start by noting that by def- inition, ei✓ = cos ✓ +isin✓. Using this expression, we obtain the following chain of equalities: 1 1 1 cos ✓ isin✓ = = ei✓ cos ✓ +isin✓ cos ✓ +isin✓ · cos ✓ isin✓ cos ✓ isin✓ = cos2 ✓ +sin2 ✓ = cos ✓ isin✓ i✓ = cos( ✓)+isin( ✓)=e . In the last few steps, we used Pythagoras theorem and the facts that cos ✓ is even and sin ✓ is odd.

Exercise 2.74 Use Definition 2.71 to verify that:

(a) ei0 =1 (b) ei⇡ = 1 (c) e2⇡i =1 (d) e⇡i/2 =i.

Exercise 2.75 (a) Express the number the complex number z =1+ion polar form z = rei✓ (that is, find the length and angle of this complex number). (b) Use this polar representation to express (1 + i)10 as simply as you can. Exercise 2.76 Use Definition 2.71 in combination with the addition formula for trigonometric functions to prove rule (ii) of Proposition 2.72. Remark: Notice that this computational rule explains geometrically what it means to multiply two complex numbers! Exercise 2.77 Explain why rule (iv) of Proposition 2.72 follows from rule (ii). 128 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS

Let us now consider roots of complex numbers. We first observe that the computa- tional rule i✓ 1 i ✓ (e ) n =en (2.2) is problematic. The complication is essentially that polar representations are not unique. For instance, we have 1=ei0 =e2⇡i =e4⇡i =e6⇡i. So, if the computational rule (2.2) would hold, this would imply that the numbers

i0 1 i0 (e ) 4 =e =1,

8 2⇡i 1 ⇡i/2 > (e ) 4 =e =i, 1 > (1) 4 = > > 4⇡i 1 ⇡i > (e ) 4 =e = 1, < 1 > 6⇡i 4 3⇡i/2 >(e ) =e = i, > > are all the same (which they are not!).:> The immediate consequence of this is the that computational rule suggested in (2.2) does not hold. However, there is another, more constructive consequence of this observation. We explain it in the following example:

Example 2.78 (complex 4’th roots of 1) Suppose we want to determine all z C 2 so that z4 =1. Above, we computed 11/4 in four different ways, and got four different results. Let us denote them z =1,z =i,z = i,z = 1. Here is what happens if we 0 1 2 3 take the 4’th power of these four different results: 4 4 z0 =1 =1,

4 4 z1 =i =1, z4 =( 1)4 =1, 2 z4 =( i)4 =1. 3 That is, all are 4’th roots of 1. Fig. 27. The fourth roots of 1.

But now the question becomes, are there any more 4’th powers of 1? Well, let us "cheat" a little bit and use the fundamental theorem of algebra (we say "cheat" because we do not prove this theorem in this course). Indeed, since z4 =1is the same as z4 1=0, any 4’th root of 1 must be a root of this polynomial. By the fundamental theorem of algebra, this polynomial has at most 4 different roots in the . Hence, the points we found above are all the 4’th roots. 2.3. SOME NEW FUNCTIONS 129

The thing is that we have now stumbled upon a general method to find all n’th roots of a complex number. First of all, the n’th roots of a number a C must be a solution 2 of the equation zn a =0. By the fundamental theorem of algebra, we therefore know that there can be at most n such roots. But can we find these n roots? Well, suppose that the number a has the polar decomposition a = rei✓. But, by what we observed above, we also recog- nize that a also has the (infinitely many) polar decompositions

i✓+2⇡ik a = re ,kZ. 2 This now gives us the following canditates for the n’th roots of the complex number a: Fig.28. The third roots of 8.As 1 i ✓ + 2⇡ik you see, they are distributed evenly zk = r n e n n ,kZ. 2 in the complex plane.

Exercise 2.79 Verify that all zk are n’th roots of a. How many different zk’s are there in total? Exercise 2.80 (a) Determine all 3’rd roots of ( 8). (b) Determine all 4’th roots of 1+i. Above, we see that complex numbers a have n unique n’th roots. And, it is not to hard to find an example where none of these roots are real (for instance, the third roots of a =1+i). So how do we give meaning to the symbol a1/n? Well, we basically have to make a choice. This is the point of the following definition:

Definition 2.81 (complex n’th roots) For a C we call all solutions of zn = a an 2 n’th root of a. The n’th root that has the smallest angle ✓ [0,2⇡) is called the principal 2 n’th root of a. We denote the principal n’th root by the symbol a1/n.

Example 2.82 The complex 4’th roots of 1 are z =1,z =i,z = 1 and z = i. 0 1 2 3 Of these, z0 =1has the smallest angle in [0,2⇡), and is therefore the principal 4’th root of 1.

Exercise 2.83 What are the complex square roots of 2? What is the principal ? Exercise 2.84 Find all complex solutions of (z 1)4 +3=0. Express the answer in polar form. 130 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS

2.4 Answers to selected exercises

2.4 (a) [ 1/4, ),(b)[ 121/4, ), (c) [ 6, ). 1 1 1 2.6 With D =( 3/2,4], we get R =( 5/4,29]. f f 2.7 Df = R ( 1,1) and Rf =[1, ). \ 1 2.12 (a) yes, (b) and (c) no since D = D . f 6 g 2.14 only the first one. 2.15 No, the circle fails the vertical line criterion. 2.18 (a) Both f g and g f are even, (b) the composition of odd functions are odd, the composition of even functions are even, and the composition of an even and an odd function will be even. 2.19 (a) g(x) is always even.

2.23 (a) The natural domain is Df g = R ( 3/2 p5/2, 3/2+p5/2) and the cor- \ responding range is Rf g =[0, ). (b) x +3px +1 with Dg f =[0, ) and 1 1 Rg f =[1, ). 1 2.24 (a) f f(x)=x. (b) Df f = R 1 . \{ } 2.26 (a) y =(x 2)/3, (b) y =(2/x + 1)/3, (c) y =(1 x)/(1 + x). 2.30 We must reduce the domain so that the function satisfies the horisontal line crite- rion. The inverses are y = px and y = px, respectively. D 1 = R R 1 = D 2.31 f f and f f . 2.32 (a) The first is monotonous and increasing, the last is monotonous and decreas- ing. The middle graph is not monotonous. (b) a function is strictly increasing if x ,x : x

2.43 (a) a b = 4,while a b = b a =4. (b) a b = 6, the rest are equal to | | | | 6, which is the distance. 2.48 The first case is when x 0.Wenowhave x = x, and the equivalence should be | | clear. The second case is when x<0.Nowx = x. Using this, we can again | | verify that the equivalence is true. 2.53 (a) ln(1) is represented by straight line, which is the same as a rectangle with area 0, (b) the rectangle has base length x 1 and height 1, (c) choose a rectangle with the same base as in (b), but with height 1/x. 2.54 The rectangle from Figure 19 has area 1, the two rectangles in Figure 20 has combined area 1/2+1/3=5/6=0.8333..., while using three such rectangles would give the combined area 1/3+1/4+1/5 = 47/60 = 0.7833... 2.55 D =[0,⇡] and D =( ⇡/2,⇡/2). Cos x Tan x 2.57 arcsin x is the inverse of Sin x,andnotsin x.Soarcsin(sin x)=x is only guaranteed to hold on DSin x. 2.58 arcsin x and arctan x are odd, while arccos x is neither even nor odd. Here is a proof of why arctan x is odd (it uses the fact that the tangent is known to be odd):

y = arctan( x) tan y = x () tan y = x () tan( y)=x y = arctan(x). () ()

2.60 tan(arcsin x)=x/p1 x2. 2.61 sin(arccos x)=p1 x2. 2.62 cos(arctan x)=1/px2 +1. 2.70 Since z/r has modulus one (check this!), it is on the unit circle, and therefore z/r = (cos ✓, sin ✓) for some angle ✓. 2.75 (a) 1+i=p2ei⇡/4,(b)(1 + i)10 =25e10i⇡/4 =25e2i⇡/4 =25ei⇡/2 =25i. 2.76 The point is to apply the addition rule for the trigonometric functions to ei(✓+) = cos(✓ + )+isin(✓ + ).

2.79 There are n different zk. ⇡i + 2k⇡i 1/8 i⇡ + k⇡i 2.80 (a) 2 e 3 3 for k 0,1,2 ,(b)2 e 16 2 for k 0,1,2,3 . · 2{ } · 2{ } 2.83 p2 and p2 are the complex square roots of 2. p2 is the principal square root. 1/4 ⇡i + k⇡i 2.84 z =1+3 e 4 2 for k 0,1,2,3,4 . · 2{ } 132 CHAPTER 2. A CLOSER LOOK AT FUNCTIONS