# The inverse of a function

1. Jun 26, 2015

### christian0710

Hi, I know that the inverse function of

y= f(x) =2x+1

is

y-1=2x
x=(y-1)/2

and then we just replace x with f-1(y) and then when we plug in any value of y it gives us a corresponding x value.

Now my question is this: If we want to find a line or function that is perpendicular to another line or function, then we do the same steps to go from y=2x+1 to x=(y-1)/2 and then we switch x and y to get
y=(x-1)/2

Why is it practical to find an inverse of a function if they both have the same graph? If you ploty y=2x+1and x=(y-1)/2 you get the same graph, so what are the practical usages for finding the inverse of a function?
Is the function that is perpendicular to another function, also a kind of an inverse even thought we switch x and y?

2. Jun 26, 2015

### RUber

The inverse of f(x) = 2x+1 is f^-1(x) = (x-1)/2.
These are not the same function, but if you plot y = 2x+1 and x= (y-1)/2, you do get the same plot, since they are the same.
If you want to find a line that is perpendicular to linear function of the form y=mx+b, you will get y = -x/m+c. The intercept c, will determine at which point the two lines intersect.

3. Jun 26, 2015

### Fredrik

Staff Emeritus
The graph of the function f defined by f(t)=2t+1 for all t, is not the same as the graph of the function g defined by g(t)=(t-1)/2 for all t. Note however that for all t, we have
\begin{align*}
&f(g(t))=2\left(\frac{t-1}{2}\right)+1=t-1+1=t,\\
&g(f(t))=\frac{(2t+1)-1}{2}=\frac{2t}{t}=t.
\end{align*}
This means that $g=f^{-1}$.

That depends on the function. Here's a fun example: Knowing that the exponential function has an inverse function (denoted by log or ln), and knowing the basic properties of that function, allows us to prove the identity $a^xb^x=(ab)^x$ in the following way:
$$a^xb^x= e^{\log a^x} e^{\log b^x} = e^{x\log a}e^{x\log b} =e^{x\log a+x\log b} =e^{x(\log a+\log b)} =e^{x \log ab} =e^{\log(ab)^x} =(ab)^x.$$

4. Jun 27, 2015

### christian0710

Then there is one thing that troubles me and unfortunately is a big contradiction: My book, calculus the infinitesimal approach, states

"Two real functions f and g are called inverse functions if the two equations
y=f(x) and x=g(y)
have the same graphs in the (x,y) planes. (In general the graph of the equation x=g(y) is different from the graph y=g(x) but is the same as the graph of y=f(x)"

So for y=x^2 (x≥0) x=√(y) is the inverse because g(y)=√(y)=√(x^2) =x

So if you plot y=2x+1vs x=(y-1)/2 you do get the same graph, but if you plot y=2x+1 vs y=(x-1)/2 don't get the same graph, so they are NOT inverse.

The contradiction: According to the book, as i understand it,

f(x) = 2x+1 and f^-1(x) = (x-1)/2)

are not inverse because f(x) and f^-1(x) = (x-1)/2) do not have the same graph. However y=f(x) = 2x+1 and g(y) = (y-1)/2) are inverse because they have the same graph and because g(y)= ((2x+1)-1)/2 = x
but if you substitute
f(x) = 2x+1=y into f^-1(x) = (x-1)/2)

you do actually get x, I'll try f^-1(f(y) = ((2x+1-1)/2= x, so it seems to be a contradiction that the definition of a inverse must have the same graphs in the (x,y) plane AND at the same time it must satisfy y=f(x) and x=g(y) while people say that f-1(x) which is a function of x (and not y) with a different graph is the inverse of y=f(x). I can't understand that :(

Last edited: Jun 27, 2015
5. Jun 27, 2015

### christian0710

I'll try with an example to sort out contradictions: Notice that wikipedia (and my book) calls f(-1)(y) for the inverse and not f(-1)(x)
To eradicate confusion of notation for myself: There are the following notations and equations
x= f(-1)(y) also called g(y) or sometimes f(y)
y=f(-1)(x)

If

y=f(x) = 2x+2

then

x=(y-2)/2 = f(-1)(f(x)) = f(-1)(y) = g(y) So we call (y-2)/2 for g(y) or f(-1)(y) or f(-1)(f(x)) when it's invers of y

The graph of f(x) and f(-1)(y)=g(y) are the same acording to wikipedia and acording to my book.

So y=f(y) and x=f(-1)(y) are inverse and have equal graphs.

However:

f-1(x) = (2-x)/2 (This is not g(y)=(2-y)/2)
Is ALSO called the inverse of f(x) or f-1(x) which is VERY confusing: However this graph is not the same as f(x) = 2x+2

Conclusion
f(-1)(y) = x=(y-2)/2=g(y)
is the inverse of y=2x+2 and they have same graphs.
f(-1)(x) = (2-x)/2= g(x)
is the inverse of x=2y+2 and they have same graphs
f(-1)(x) = (2-x)/2 =g(x)
and f(-1)(y) = x=(y-2)/2=g(y) are not inverse and do not have same graph.
f(x)= 2x+2 and g(x)=(2-x)/2 are not inverse because they don't have the same graphs (acording to wikipedia and calculus an infinitesimal approach)

Last edited: Jun 27, 2015
6. Jun 27, 2015

### Fredrik

Staff Emeritus
They're not saying that f and g have the same graphs. They're saying that the sets $\{(t,f(t))|t\in\mathbb R\}$ and $\{(g(t),t)|t\in\mathbb R\}$ are the same. They're calling these sets the graphs of the equations y=f(x) and x=g(y) in the (x,y) plane. The former is the graph of f, but the latter isn't the graph of g. The graph of g is the set $\{(t,g(t))|t\in\mathbb R\}$.

You seem to be confusing functions defined by equations with the corresponding equations. Equations don't have inverses. They do however have graphs, and two equivalent equations have the same graph. The equations y=2x+1 and x=(y-1)/2 are equivalent in the sense for all values of x and y, they're either both true or both false.

If someone is saying that $f^{-1}(x)$ (a string of text that represents a number) is the inverse of y=f(x) (a string of text that tells us something about the numbers represented by the variables inside it), they're not paying attention to what what the strings of text they're writing down actually represent. A function may have an inverse. A string of text may not.

Your calculation of $f^{-1}(f(y))$ is wrong. For all real numbers y, we have
$$f^{-1}(f(y))=\frac{f(y)-1}{2} =\frac{2y+1-1}{2}=y.$$ Note that the "for all" makes y a dummy variable. You can replace y with any other variable (including x) without changing the meaning of the statement.

7. Jun 27, 2015

### Fredrik

Staff Emeritus
The equations are equivalent, not inverse, and because of that their graphs are the same. The functions $f$ and $f^{-1}$ do not have the same graph.

If you want to see what the graph of $f^{-1}$ looks like, draw the graph of $f$ on a sheet of transparent plastic. Then rotate the sheet 90 degrees counterclockwise and then flip the sheet over, the way you would turn a page in a book. You are now looking at the graph of $f^{-1}$.

I think it would be useful for you to stop thinking of f(x) as a function. f is the function. f(x) is a number in its range. The inverse of f is neither $f^{-1}(x)$ nor $f^{-1}(y)$, it's $f^{-1}$. Of course, when the variable that you put into the function is the target of a "for all", it makes absolutely no difference what variable you're using. The statements

For all real numbers x, we have $f^{-1}(x)=\frac{x-1}{2}$.
and

For all real numbers y, we have $f^{-1}(y)=\frac{y-1}{2}$.
are saying exactly the same thing.

8. Jun 27, 2015

### christian0710

Fredering, thank you so much for responding. I've spent a long time reading your post, and I think i might understand it now, and i feel like I'm learning a lot:
So let's se if I'm on the right track.

1) Equations don't have inverses, only functions do.

2)
two equivalent equations have the same graph.
So f and g are inverse functions if and only if the
equation of f, y=f(t), has an equivalent euqation t=g(y)
meaning that the sets of the 2 equations ({(t,f(t))|t∈R}
and {(g(t),t)|t∈R} are the same. So If the equation of f has an equaivalent
equation t=g(y) then a function,g, must belong to the equation g(t)=y , and this function must
be the inverse of f.

So in our example the equation of f is y=2x+2 so the equivalent equation is found by isolating x, x=(y-2)/2=g(y) and the sets of the 2 equations
({(t,f(t))|t∈R}
and {(g(t),t)|t∈R} are equivalent. To find the equation g(t)=y for the function g, we just switch x and y, g(x)=(x-2)/2 So this function is the inverse of f.

so f(-1)=g(x) because f(g(x)) = x which is the same as saying f(f(-1)(x)) and g(f(x))= x-
3) So how do i interprete f−1(x)=(x−1)/2. and f−1(y)=(y−1)/2, do I call them inverse functions of f with respect to y, or with respect to x?
5) Is there a depper mathematical name for the process of swapping y out with x to get the inverse function?
6) Are there true equations with no possible functions?

Last edited: Jun 27, 2015
9. Jun 27, 2015

### RUber

To add onto Fredrik's last post, when you are not dealing with functions that are defined like $f:\mathbb{R}\to\mathbb{R}$ like the simple functions listed in your examples, you will need to really pay attention to the domain and range of the function.
Say, for example, $f(x) = \sin x$ $f: \mathbb{R} \to [-1, 1]$, so if $f(x) = y, y \in [-1, 1]$. Your inverse function should only have the domain of $[-1, 1]$ and a range of $\mathbb{R}$. Unfortunately, $\sin$ is periodic, so there is no way to tell if an original x was x, x+2pi, x-2pi, or any other member of $[x]: \{s| s = x +2k\pi, k \in \mathbb{Z}\} .$ The best inverse of sine, arcsine, will return a number in $[0, 2\pi)$.

10. Jun 27, 2015

### RUber

In response to your number 3, any function defined by f(y) = 2x doesn't mean anything, since the input of the function is y and you are defining the output in terms of x, which we know nothing about.
number 5, the swapping of x and y is simply a technique used to solve for the inverse--enforcing the condition that if f(x) = y, and g(y) = x, then f and g are inverses.

11. Jun 27, 2015

### christian0710

Thank you very much for clarifying, acutally to #3 i meant f−1(x)=(x−1)/2. and f−1(y)=(y−1)/2,, but added a x instead of y, so sory for that!
But I would think f−1(x)=(x−1)/2. and f−1(y)=(y−1)/2, are 2 very different functions? But now i think the point Frederik was making is that f−1(x)=(x−1)/2. and f−1(y)=(y−1)/2, don't mean inverse of a function like f(-1) does, but sloppy mathematicians can get away with writing it anyway?? :-)

12. Jun 27, 2015

### RUber

$f^{-1}(x) = (x-1)/2$ is exactly the same as $f^{-1}(y) = (y-1)/2$ since the equation is simply illustrating the action of the function on its input.
The only reason a function of y would be different from a function of x would be if you were defining the domains of x and y to be different, and implicitly imposing those as the domains for the function.

The equation - function debate can be thought of this way:
a function takes an input and gives an output. It can be defined in many ways.
Many mathematical functions are defined based on an input x, and the output is expressed as a relationship to the input, i.e. f(x) = 2x.
That means for any x, the equation will be true. But the function is the doubling function. The inverse of the doubling function is the halving function, which for any x the equation g(x) = x/2 holds true.

13. Jun 27, 2015

### Fredrik

Staff Emeritus
Two functions f and g are equal if and only if they have the same domain, and f(x)=g(x) for all x in that domain. So if we define f and g by the statements

$f(x)=\frac{x-1}{2}$ for all real numbers x
and

$g(y)=\frac{y-1}{2}$ for all real numbers y
we will have f=g. They will both have domain $\mathbb R$, and for all real numbers t, we will have
$$f(t)=\frac{t-1}{2}=g(t).$$ This implies that f=g.

14. Jun 27, 2015

### christian0710

Thank you, it makes a lot of sense: Just a question more: If i take let's say a function f with the equation y=2x+2, then solve for x --> x=(y-2)/2 then according to my book which states

"Two real functions f and g are called inverse functions if the two equations
y=f(x) and x=g(y)
have the same graphs in the (x,y) planes"

This means that y=2x+2, belongs to f with the set {(x,f(x))|x∈R}, and that x=(y-2)/2)=g(y) belongs to the set {(g(x),x)|x∈R} (This is what Frederik wrote). So my question is, Is this correct to write, if a function is called g(y)= (y-2)/2 could you say the set is {(g(x),x)|x∈R} or should you you say {(g(y),y)|x∈R}, if i know g(y)=x my logic tells me you can write both.

Wau i totally just spent a complete day trying to understand this topic, but now at least i feel smarter. ^^

15. Jun 27, 2015

### christian0710

Thank you frederik! It's liberating to understand something!
So a last question to make sure i understand this 100% :

1) On mathisfun.com the inverse of a function f is calculated like this

f(x)=2x+3 --> x=(y-3)/2, then x is swapped with f(-1)(y) but y is not swapped with x So and so it's concluded that we have the inverse f(-1) =(y-3)/2,

This seems wrong because we agreed that in my book

Two real functions f and g are called inverse functions if the two equations
y=f(x) and x=g(y)
have the same graphs in the (x,y) planes.

So you wrote

They're saying that the sets {(t,f(t))|t∈R} and {(g(t),t)|t∈R} are the same.and the set of g the inverse is {(t,g(t))|t∈R}.

So in this example y=f(x) has a function f with the set {(t,f(t))|t∈R}
x=g(y) should have been g(y)=(y-3)/2, with the set {(g(t),t)|t∈R} and NOT the inverse?? Or am i misunderstanding it?
And when we do the swapping of x and y (which was not done on the website)
f(-1) =(x-3)/2,

Is this the correct understanding?

16. Jun 27, 2015

### RUber

It seems like you are getting confused about x and y. The variable doesn't matter. You can define the function as a function of x or y. What matters is that IF y = f(x), then the graph (x,y) = (x, f(x) ) should look exactly like (f^{-1}(y), y) = (x,y). This only holds true if you first define y = f(x).
The definitions of the functions themselves can use any variable you want, x, y, t, z, s, apples, elephants, etc.

17. Jun 27, 2015

### christian0710

This is the only part i don't get: g(y)=(y-2)/2 and g(x)=(x-2)/2 are equal BUT if this is true then a function belonging to x=g(y)=(y-2)/2 would then be the same as a function belonging to g(x)=(x-2)/2 and then the graph of x=g(y) is the same as the graph of the equation for the inverse g(x)=(x-2)/2 ,
And this istrouble beacuse the graph of g(y)=x is also the same as the graph of f(x)=2x+2

18. Jun 27, 2015

### christian0710

So If we define y=f(x) and has the set of points (x,y), then why exactly should the graph look like (f^{-1}(y), y) = (x,y)? Sory I'm a but confused about what This proves.

If I'm misunderstanding you, would you be so kind as providing a small example?

19. Jun 27, 2015

### Staff: Mentor

The short version of the above is that if $x = \frac{y - 2}{2}$, you can solve for y and get 2x = y - 2, so y = 2x + 2.

The equation $x = \frac{y - 2}{2}$ is equivalent to y = 2x + 2, which means that every ordered pair (x, y) that is on one graph is also on the other.
The first equation, $x = \frac{y - 2}{2} = g(y)$, gives x as a function (g) of y. The second equation, y = 2x + 2 = f(x), gives y as a function (f) of x. In this case, f and g are inverses of each other. You can verify that f(g(y)) = y, and that g(f(x)) = x for all choices of y and x.

For a "nice enough" equation in x and y, a function and its inverse give the relationships between x and y. By "nice enough" I mean an equation that pairs x and y values in a one-to-one relationship in both directions. That is, for each y value, there is exactly one x value that pairs with it, and for each x value there is exactly one y value that pairs with it. Functions whose graphs are straight lines represent one-to-one functions.

20. Jun 27, 2015

### Fredrik

Staff Emeritus
The graph of an equation that contains the variables x and y is the set of all pairs (x,y) that satisfy the equation. (It's conventional to put x first, but it's really nothing more than a convention). In this case we're talking about all (x,y) such that that y=f(x), and all (x,y) such that x=g(y). These sets are the same if and only if the equations are equivalent. In that case, they're both the graph of f. The graph of g is the set of all (x,y) such that y=g(x), or equivalently, the set of all (y,x) such that x=g(y).

The equation is just a string of text, and doesn't belong to a subset of $\mathbb R^2$. x and y are real numbers, so they can't be elements of such a set either.

The graph of f is by definition the set of all pairs (x,y) such that y=f(x). Since the equations y=f(x), y=2x+2, x=g(y) and x=(y-2)/2 are all equivalent, every pair (x,y) that satisfies one of these equations, satisfies them all.

The sets $\{(x,f(x))|x\in\mathbb R\}$ and $\{(g(x),x)|x\in\mathbb R\}$ are the same. Proof: Let (a,b) be a element of $\{(x,f(x))|x\in\mathbb R\}$. We have b=f(a). This implies that a=g(b). So $(a,b)=(g(b),b))\in \{(g(x),x)|x\in\mathbb R\}$. Let (c,d) be an element of $\{(g(x),x)|x\in\mathbb R\}$. We have c=g(d). This implies that d=f(c). So $(c,d)=(c,f(c))\in\{(x,f(x))|x\in\mathbb R\}$.

The function would be called g, not g(y) or g(y)=(y-2)/2. But it can be defined by the equality g(y)=(y-2)/2, if this equality is interpreted as a "for all" statement, i.e. if it's interpreted as saying exactly this:

For all real numbers t, we have $g(t)=\frac{t-2}{2}$.

Those sets are the same. But I don't quite understand the question. You're asking about "the set". What set is that? The graph of g? It's not the set in the quote above. It's $\{(x,y)|x\in\mathbb R,~y=g(x)\}$.

f(x)=2x+2 doesn't imply x=(y-3)/2, because there's no y in the former. I guess you meant that y=2x+3 implies that x=(y-3)/2. If we define f by f(t)=2t+3 for all real numbers t, then we can write the first equation as y=f(x). If we define g by g(t)=(t-3)/2 for all real numbers t, we can write the second equation as x=g(y). Now you can see that f and g are each other's inverses by verifying that f(g(s))=s=g(f(s)) for all real numbers s.

The point of "swapping x and y" is only that people like to denote the input by x and the output by y. The graph of g is by definition the set $\{(s,t)|s\in\mathbb R,~t=g(s)\}$. If we want to denote the input by x and the output by y, we can rewrite this as $\{(x,y)|x\in\mathbb R,~y=g(x)\}$. I wouldn't think of this as swapping x and y. We're just choosing to denote the input by x and the output by y.

21. Jun 27, 2015

### Staff: Mentor

A couple of examples.
1. $x = \frac{y - 2}{2}$ and y = 2x + 2
The ordered pairs (0, 2), (1, 4), and (2, 6) satisfy both equations, which means that each of these points is on both graphs. In fact, every ordered pair that satisfies the first equation also satisfies the second, and vice versa. By "ordered pair" I mean that the first number in the pair is the x value, and the second number is the y value.

2. $y = x^2$ and $x = \sqrt{y}$
The first equation above is not one-to-one, since the graph contains (1, 1) and (-1, 1), (2, 4) and (-2, 4), and so on. To get around this problem, we restrict the domain to a set of numbers to make the underlying function one-to-one. One way to do this is to restrict the domain to {x | x ≥ 0}.

If $y = x^2, \text{ and } x \ge 0$ and $x = \sqrt{y}$, now every ordered pair that satisfies the first equation, also satisfies the second, and vice versa. Som examples include (0, 0), (1, 1), (2, 4), and so on. The ordered pair (-2, 4) satisfies y = x2, but -2 is not in the restricted domain, so we don't consider this point.

22. Jun 27, 2015

### Fredrik

Staff Emeritus
You're too careless with your statements. I think that contributes to the confusion. Here you're saying that two equalities are equal. That doesn't make sense. Maybe you meant that they're equivalent statements (because that would resemble what I said), but without the "for all", they're not statements at all. A statement is either true or false. An equality like g(x)=(x-2)/2 can be true for some values of x and false for others. That's why an equality alone isn't a statement.

The rest of that post is even more confusing.

23. Jun 27, 2015

### RUber

What I mean is that if $y = f(x)$ then, by definition, $f^{-1}(y) = x.$
So, by simple substitution you have: $(x,y) \equiv (x, f(x)), \equiv (f^{-1}(y), f(x))\equiv (f^{-1}(y), y )\equiv (x, y).$
The plots are the same because the points are the same...by defining y=f(x).

However, when defining the function f and its inverse, you can do so with any dummy variable, as long as the domain and range are either known or implied.
Example, if you have a function defined by the relation $f(v) = 2v$ and its inverse $g(a) = a/2$ then defining y = f(x) implies that y = 2x.
You might quickly be able to see that if y=f(x), then g(y) = g(f(x))= (2x)/2= x.
Notice that if you were to plot these functions, (x,f(x) ) would generate points like (0,0), (1,2), (2,4)... and (g(x),x) would generate points like (0,0), (1/2,1), (1,2) ...
As has already been defined, these are plotting the same line, just in different ways.
One function tells you an input in terms of the x coordinate and tells you where to plot the y-coordinate, the inverse assumes an input in the y coordinate and tells you where to plot the x coordinate.

I feel like we have been discussing this concept for a while now. I would recommend taking a few simple functions, finding their inverses and plotting them to get a feel for what they are doing. If you still aren't clear after doing that, reread this thread and let us know where you are getting hung up.

24. Jun 27, 2015

### christian0710

It's just the above statement that makes me believe that there a difference between x=g(y) and the inverse of f : it sounds to me like you are saying y=f(x) has the same graph as x=g(y) ( and i agree because the sets are the same) but you also mention that the function of g, has a different graph than x=g(y) and y=f(x), so it led me to think the graph of the inverse of f, must be found by swapping x and y in x=g(y) to form g(x)=(x-2)/2 and so the function of this graph is the inverse.

So in total we have a total of 3 equations. and x=g(y) is equivalent to both f(x) and g(x), but f(x) is not equivalent to g(x).

1) y=f(x) =2x +2 -----> belongs to f
2) x=g(y) = (y-2)/2 -----> is equivalent to f and the inverse of f , but this is not the inverse
3) g(x)=g(-1)=(x-2)/2. ------> Is inverse of f

25. Jun 27, 2015

### RUber

1. I don't fully understand what you mean by "belongs to f".
2. g is the inverse of f, so IF y = f(x), then x = g(y), but IF y = f(x) then f(y) is not equal to f(x), it is equal to f(f(x)) = 2(2x+2)+2 = 4x+6.
3. g(x) will return y is x = f(y), since g is the inverse of f, so g(f(y))=y and g(f(x))=x.