Inverses

In an earlier lesson, we introduced functions by assigning US citizens a social security number (SSN) or by assigning students and staff at Sam Houston State University a student ID (SamID) Elementary Functions The function SamID assigns to each student or staff a nine digit number that begins with three zeroes. The Sam ID of the authors of these notes is Part 1, Functions 000354765, so SamID(Ken W. Smith) = 000354765. Lecture 1.6a, Function Inverses In practice, it is important not only that SamID be a function, but that the function process can be reversed. Computer databases at Sam Dr. Ken W. Smith Houston allow a staff member to type in the Sam ID and pull up information about the student/staff member. Each Sam ID number is Sam Houston State University linked to a unique student/staff member! 2013 This is the concept of an . If SamID maps student/staff to numbers, the inverse function, SamID−1 maps numbers to student/staff. (So SamID−1(000354765) = Ken W. Smith.)

Smith (SHSU) Elementary Functions 2013 1 / 33 Smith (SHSU) Elementary Functions 2013 2 / 33 Function Inverses Function Inverses

The meaning of function inverse In many applications, we need to reverse the function process, asking for the input x associated with an output y = f(x). Given a function f(x), with inputs x and outputs y, we would like to reverse the process, taking outputs y and restoring the original input x to create f −1(x). In the picture above, we have a function f from the X (the domain) to Y (the .) We would like to create an inverse function with domain Y that maps back to X. We write f −1 for the new function that reverses the process of function f. 1 Note that f −1 is NOT the reciprocal of f(x). It is NOT ! f

Smith (SHSU) Elementary Functions 2013 3 / 33 Smith (SHSU) Elementary Functions 2013 4 / 33 Function Inverses Function Inverses

Suppose f : {a, b, c} → {1, 2, 3} is described in the first picture below (from Wikipedia.) Then f −1 is described by the second picture. Notice how f −1 reverses the inputs and outputs.

Warning! The superscript −1 indicates the inverse function. 1 f −1 is not the same as . f

Not every function has an inverse. We will look at some examples of functions where we can reverse the process and some examples where we cannot.

Smith (SHSU) Elementary Functions 2013 5 / 33 Smith (SHSU) Elementary Functions 2013 6 / 33 Function inverses, examples Function inverses, examples

Examples. 1 Let f(x) = 3x + 5. Write this function in the form y = 3x + 5. 2 Suppose we are given a particular output y. Can we recover x? 2 f(x) = x with domain R and codomain R. Yes. Let’s take the y = 3x + 5 and solve for x: If we write y = x2, and we are given a particular value of y, say y − 5 y = 3x + 5 =⇒ y − 5 = 3x =⇒ = x. y = 25, can we reverse the process and find x? 3 No, not in this case, for both x = −5 and x = 5 are mapped to y−5 We have discovered that if we are given y then x = 3 . y = 25 by this function. y − 5 There are two different inputs that are both mapped to 25 so we g(y) = . 3 cannot reverse our process in a unique way. We follow custom and use x for inputs and y for outputs so we write The function f(x) = x2, with domain , does not have an inverse x − 5 R g(x) = or function. 3

x − 5 f −1(x) = . 3 Smith (SHSU) Elementary Functions 2013 7 / 33 Smith (SHSU) Elementary Functions 2013 8 / 33 Changing the domain to create an inverse function

Occasionally, if a function does not have an inverse, we may be able to change the domain of the function so that on this new domain the function is invertible. We can do that in this last example. Elementary Functions Part 1, Functions We could change our function so that the domain is the [0, ∞) Lecture 1.6b, Computing Function Inverses instead of (−∞, ∞). If we agree that no negative numbers are input into this function, then the ambiguity about x goes away. Dr. Ken W. Smith If y = 25 then x must be equal to 5, not −5. In this case, if f : [0, ∞) → (−∞, ∞) is defined by f(x) = x2 then the Sam Houston State University √ inverse function is f −1(x) = x. 2013 In the next presentation we will practice inverting functions.

(END)

Smith (SHSU) Elementary Functions 2013 9 / 33 Smith (SHSU) Elementary Functions 2013 10 / 33 Computing function inverses Finding an inverse function by reversing the operations

A function f : D → C has an inverse f −1 : C → D if and only if f is both a one-to-one function and an onto function. Sometimes it is obvious that function has an inverse. Sometimes a function may be defined in terms of a of operations and each of If the function f is onto then every of C has at least one them is reversible. preimage back in D. For example, consider the function f(x) = x + 4. If the function f is one-to-one then every element of C which has a What does f do to an input? preimage has a unique preimage. (Recall that this uniqueness is the critical Easy – it adds 4 to every input. part of the definition of a function!) How would one reverse that? −1 (A separate presentation will focus more on one-to-one and onto By subtracting 4 from every input. So f (x) = x − 4. functions.)

Smith (SHSU) Elementary Functions 2013 11 / 33 Smith (SHSU) Elementary Functions 2013 12 / 33 Finding an inverse function by reversing the operations Finding an inverse function by reversing the operations

One more example, the more complicated invertible function seen earlier: suppose f(x) = 3x + 5. Consider the function f(x) = 3x. What is the inverse function? What does f do to every input? The function f(x) = 3x + 5 first multiplies the input by 3 and then adds It multiplies each input x by 3. 5. How would one reverse “multiplication by 3”? So to reverse this function process we should first subtract 5 and then By dividing by 3. divide by 3. So the inverse function must divide each input by 3. x − 5 So the inverse function should be f −1(x) = . −1 x 3 With this simple logic, we see that f (x) = 3 . (Notice that when we reverse the processes here, we also reversed the order of the operations. The function f multiplies and then adds so f −1 must first subtract and then divide.)

Smith (SHSU) Elementary Functions 2013 13 / 33 Smith (SHSU) Elementary Functions 2013 14 / 33 Finding an inverse function algebraically Function inverses, worked examples

Some worked exercises. Use algebra to find the inverse function of each function given below. If the function f(x) is defined by an equation then we can also find the 1 f(x) = x + 4 inverse algebraically. Solution. One way to do this is to write out the equation y = f(x) and solve for x, To find the inverse of f(x) = x + 4 we write y = x + 4 and then solve for getting a function x = g(y). x by subtracting 4 from both sides: y − 4 = x. Once this is done, we bow to custom and swap the letters x and y so that Now that we have solved for x, we swap letters x and y and write x represents the input for our new function and y represents the output. x − 4 = y. So our answer is Thus our final answer will be y = g(x). f −1(x) = x − 4. We will do some examples. We swapped our letter x and y at some point since we are following the tradition that x is the input and y is the output. We could have done this swap of letters at the beginning of the problem and then solved for y. Smith (SHSU) Elementary Functions 2013 15 / 33 Smith (SHSU) Elementary Functions 2013 16 / 33 Function inverses, worked examples Function inverses, worked examples

3 Find the inverse of f(x) = 3x + 5. 2 Find the inverse of f(x) = 3x Solution. To find the inverse of f(x) = 3x we write y = 3x. Solution. Let’s swap our letters x and y to announce that we are changing inputs To find the inverse of f(x) = 3x + 5 we first write y = 3x + 5 and then and outputs. (now or later) exchange the letters x and y to indicate that old inputs are now outputs and old outputs are now inputs. So write x = 3y. x = 3y + 5

Then solve for y by dividing both sides by 3: We solve for y by subtracting 5 from both sides and then dividing both sides by 3, to get x/3 = y. x − 5 = y. 3 So our answer is So our answer is −1 f (x) = x/3. x − 5 f −1(x) = . 3

Smith (SHSU) Elementary Functions 2013 17 / 33 Smith (SHSU) Elementary Functions 2013 18 / 33 Function inverses, worked examples Function inverses, worked examples √ 3 1 4 f(x) = x + 9 5 f(x) = x + 1 Solutions. √ 1 1 To find the inverse of f(x) = x3 + 9 we write Solutions. To find the inverse of f(x) = we write y = and x + 1 x + 1 p 3 swap letters y = x + 9 1 x = swap letters y + 1 p x = y3 + 9 We solve for y by first multiplying both sides by the denominator y + 1. and then solve for y by squaring both sides: x(y + 1) = 1. x2 = y3 + 9, To solve for y, we need to isolate y. Let’s multiply out: then subtracting 9 from both sides, yx + x = 1 x2 − 9 = y3, and subtract x from both sides, and then taking the root of both sides, yx = 1 − x.

p3 x2 − 9 = y. Finally we can solve for y by dividing both sides by x: So 1 − x So our answer is f −1(x) = . Smith (SHSU) Elementary√ Functions 2013 19 / 33 Smith (SHSU) Elementary Functionsx 2013 20 / 33 f −1(x) = 3 x2 − 9. (END) Geometric meaning of inverse (& )

When we create the inverse function, we interchange inputs and outputs. In the plane, we interchange x and y and so swap x-axis with y-axis. We swap the x-axis & y-axis by reflecting across the line y = x. Elementary Functions Here (from Wikipedia) is a picture displaying that effect. Part 1, Functions Lecture 1.6c, Function Inverses: Mathematical Meaning of Inverses The graph of y = f(x) (in red) becomes the graph of y = f −1(x) in blue.

Dr. Ken W. Smith

Sam Houston State University

2013

Smith (SHSU) Elementary Functions 2013 21 / 33 Smith (SHSU) Elementary Functions 2013 22 / 33 The mathematical meaning of “inverse” Function Inverses

In mathematics, the “inverse” of an is something that undoes, A worked exercise. √ reverses the operation. If we are adding then the inverse of 4 is −4. (−4 is 3 1 Verify, by√ , that f(x) = x + 9 and called the “” of 4.) g(x) = 3 x2 − 9 are inverse functions. 1 1 If we are multiplying then the inverse of 4 is 4 . ( 4 is called the “” of 4.) Solution. If we are composing functions then the inverse of f is the inverse function We compute −1 q √ f . These types of inverses are different; don’t confuse them! p 3 p p3 3 (g◦f)(x) = g( x3 + 9) = ( x3 + 9)2 − 9 = (x3 + 9) − 9 = x3 = x. If we compose f and f −1 we get the function which merely maps x to x. So (This is the “.”) (g ◦ f)(x) = x. For example, if f(x) = x + 4 then the function f adds four to the input x. The inverse function g(x) = x − 4 subtracts four from the input. Similarly, we can compute q √ If we apply f and then g we will first add four to x and then subtract four, p3 p3 p (f◦g)(x) = f( x2 − 9) = ( x2 − 9)3 + 9 = (x2 − 9) + 9 = x2 = x. returning to the original input. In functional notation, (Here we need to assume that x is not negative.) So g(f(x)) = g(x + 4) = (x + 4) − 4 = x. (f ◦ g)(x) = x. Since the composition of f and g (in either order) return x to x, f Smith (SHSU) Elementary Functions 2013 23 / 33 andSmithg (SHSU)are inverse functions.Elementary Functions 2013 24 / 33 Function Inverses

When does a function f have an inverse? Elementary Functions It turns out that there are two critical properties necessary for a function f Part 1, Functions to be invertible. Lecture 1.6d, Function Inverses: One-to-one and onto functions The function needs to be “one-to-one” and “onto”. In the next presentation, we explore “one-to-one” and “onto” functions. Dr. Ken W. Smith

(END) Sam Houston State University 2013

Smith (SHSU) Elementary Functions 2013 25 / 33 Smith (SHSU) Elementary Functions 2013 26 / 33 Function Inverses One-to-one functions*

A function like f(x) = x2 maps two different inputs, x = −5 and x = 5, to the same output, y = 25. But with a one-to-one function no pair of inputs give the same output. Here is a function we saw earlier. This function is not one-to-one since When does a function f have an inverse? both the inputs x = 2 and x = 3 give the output y = C. It turns out that there are two critical properties necessary for a function f to be invertible. The function needs to be “one-to-one” and “onto”.

Smith (SHSU) Elementary Functions 2013 27 / 33 Smith (SHSU) Elementary Functions 2013 28 / 33 Function Inverses Other common terms for one-to-one functions.

We can define one-to-one function more formally, as a mathematical implication:

A function f is one-to-one if f(a) = f(b) =⇒ a = b.

One can think of this implication this way: “A function is one-to-one if whenever it appears that two inputs a and b give the same output, in fact A one-to-one function is sometimes called an injection or an injective a and b were the same.” function. Let’s show that the function f(x) = 3x + 5 defined earlier is one-to-one. Wikipedia uses the term “” in the article here. We do this is a series of steps:

1 Suppose that f(a) = f(b). 2 Then 3a + 5 = 3b + 5. 3 Subtract 5 from both sides to get 3a = 3b. 4 Divide both sides by 3 to get a = b. Since we have shown that f(a) = f(b) =⇒ a = b, the function f(x) is one-to-one. Smith (SHSU) Elementary Functions 2013 29 / 33 Smith (SHSU) Elementary Functions 2013 30 / 33 Onto functions* Other common terms for onto functions.

A function f : D → C is onto if every possible output in C is truly an output, that is, if the range of f is equal to the entire codomain C.

An onto function is sometimes called a surjection or a . Wikipedia uses the term “surjective function” in the article here.

In the figure above, the function is not onto because the element B is the codomain is not an output. (The element A is also not an output of the function.) The codomain is Y = {A, B, C, D} but the range is just {C,D}. If f(x) = y then we say that y is the of x and that x is the preimage of y. If a function f : D → C is onto then every element of the codomainSmith has (SHSU) a preimage. Elementary Functions 2013 31 / 33 Smith (SHSU) Elementary Functions 2013 32 / 33 Inverse functions

A function f : D → C has an inverse f −1 : C → D if and only if f is both a one-to-one function and an onto function. If the function f is onto then every element of C has at least one preimage back in D. If the function f is one-to-one then every element of C which has a preimage has a unique preimage. (Recall that this uniqueness is the critical part of the definition of a function!)

(END)

Smith (SHSU) Elementary Functions 2013 33 / 33