Interchanging x and y for inverse function

In summary, the two variables are probably swapped so that the X-axis on the standard X-Y graph would be horizontal and the Y-axis vertical. Swapping them changes their definitions.
  • #1
ChiralSuperfields
1,222
132
Homework Statement
Please see below
Relevant Equations
Please see below
For this,
1680575483637.png

Why are we allowed to interchange x and y? Is it because the equation will still be true?

Many thanks!
 
Physics news on Phys.org
  • #2
I wouldn't swap x and y. They are probably doing it so that the graph on the usual X-Y grid would have the X-axis horizontal and the Y-axis vertical. Swapping them changes their definitions. Certainly, if the variable names had some real meaning, like ##height = age^3 + 2##, you wouldn't want to swap the variables.
 
  • Like
Likes mathwonk and ChiralSuperfields
  • #3
Consider this example

## f(x) = e^x##
## g(x) = \ln (x) ##

##g(x)## is the inverse function of ##f(x)## and we thus write ##g = f^{-1}##.

What we mean by this is that ##g(f(x)) = f(g(x)) = x## or in other notation ## f^{-1}(f(x)) = f(f^{-1}(x)) = x##.

Now, how we label the variables is not important when it comes to functions, we can write for instance ##f(\alpha) = e^\alpha## or ##f(y) = e^y## and so on. However, if we insist in writing ##y = e^x## then ##x## is a number in the domain ##D_f## of ##f## and ##y## is a number in the codomain ##V_f## of ##f##. Thus, when we "interchange" ##x## and ##y## to write the inverse function with ##x## as the value of its domain, we need to make sure that this number is in the codomain of ##f##. Back to your example:

## f(x) = x^3 + 2##, ##x \in D_f##
## f^{-1}(x)= \sqrt[3]{x^3-2}##, ## x \in V_f##

Now, check for yourself that ## f^{-1}(f(x)) = f(f^{-1}(x)) = x## for your problem.
 
Last edited:
  • Like
Likes Gavran, WWGD, ChiralSuperfields and 1 other person
  • #4
FactChecker said:
I wouldn't swap x and y. They are probably doing it so that the graph on the usual X-Y grid would have the X-axis horizontal and the Y-axis vertical. Swapping them changes their definitions
I agree with this sentiment completely.
If ##y = x^3 - 2 = f(x)##, then ##x = \sqrt[3]{y - 2} = f^{-1}(y)##
The graphs of the two equations ##y = x^3 - 2## and ##x = \sqrt[3]{y - 2}## are exactly identical, meaning any pair of numbers (x, y) that satisfies the first equation also satisfies the second equation.

In subsequent classes such as calculus, one sometimes needs to find the inverse in order to evaluate a definite integral. In such cases it is counterproductive and foolish to swap variables.

As @FactChecker mentioned, swapping variables changes the definitions of the variables.
As an example, consider the conversion formulas for changing from Fahrenheit temperature to Celsius: ##f(C) = F = \frac 9 5 C + 32## and ##f^{-1}(F) = C = \frac 5 9 (F - 32)##
You can verify these formulas with pairs such as (0, 32), (20, 68), and (100, 212), where the first number in a pair is the Celsius temperature and the second is its Fahrenheit equivalent.
Swapping variables in these formulas leads to nothing but confusion.
 
  • Like
Likes mathwonk, WWGD, ChiralSuperfields and 2 others
  • #5
I agree that swapping variables introduces confusion and loses insight as to the meaning of the variables. I also agree with malawi_glenn that logically it does not matter, but then I would insist on including quantifiers. I.e. when writing things like g(f(x)) = x and f(g(x))= x, I would say explicitly "g(f(x)) = x for all x in domain f", and "f(g(x)) = x for all x in domain g", so that it is more clear that the two uses of x refer to elements of different sets, rather than taking that for granted as "obvious".
 
  • Like
Likes ChiralSuperfields and malawi_glenn
  • #6
A nice example where this matters if f(x) =x^2, what is the inverse function? Well in order to obtain that, we need to define the domain of f first. I leave this as an excerise for the OP to think about
 
  • Like
Likes ChiralSuperfields
  • #7
I don't know if this is helpful towards understanding the issue, but the Inverse/Implicit function theorems help determine when y is a function of x, as well as vice-versa, re @malawi_glenn example of ##f(x)=x^2##.
But there are other real life examples where relationships in one direction don't go in the opposite one.
 
  • Like
Likes ChiralSuperfields
  • #8
malawi_glenn said:
A nice example where this matters if f(x) =x^2, what is the inverse function?
As stated, f does not have an inverse that is itself a function. As an aside, the domain of f is all real numbers.

malawi_glenn said:
Well in order to obtain that, we need to define the domain of f first. I leave this as an excerise for the OP to think about
A better choice of words is that we need to restrict the domain of f to some set of numbers so that f is one-to-one on this restricted set.
 
  • Like
Likes ChiralSuperfields
  • #9
Mark44 said:
A better choice of words is that we need to restrict the domain of f to some set of numbers so that f is one-to-one on this restricted set.
Maybe, I do not know how well know it is or not that if I just type "f(x) = x^2" then per default the domain is all real numbers?
Mark44 said:
As an aside, the domain of f is all real numbers
Why not all complex numbers?
 
  • Like
Likes ChiralSuperfields
  • #10
malawi_glenn said:
Maybe, I do not know how well know it is or not that if I just type "f(x) = x^2" then per default the domain is all real numbers?
Yes. A function always has a domain. If the domain is not explicitly stated, it is implied to be the set of all real numbers for which the function's formula produces an output value.

For example, if the formula for a function is given as ##f(x) = \frac 1{(x -1)^2}##, the implied domain is ##\{x \in \mathbb R| x \ne 1\}##, or equivalently, ##(-\infty, 1) \cup (1, \infty)##.
malawi_glenn said:
Why not all complex numbers?
Whether the domain is real versus complex numbers is usually determined by context. In addition, functions that are defined on complex numbers often use z as the argument.
 
Last edited:
  • Like
Likes ChiralSuperfields
  • #11
ChiralSuperfields said:
Homework Statement: Please see below
Relevant Equations: Please see below

For this,
View attachment 324465
Why are we allowed to interchange x and y? Is it because the equation will still be true?

Many thanks!
At risk of running against the grain of this thread, I would say that quite simply it's because a function and its inverse are symmetrical about the line y=x. So if (for example) the point (4,5) is on f(x) , then the point (5,4) is on the graph of ##f^{-1}(x)##. Another way of putting that is that the graph of ##f^{-1}(x)## may be obtained by reflecting all points on the graph of f(x) in the line y=x. And that's the basic rationale for the method described in your text book.

Consider, for example: $$f(x)=y=x^2-10x+24=(x-4)(x-6).$$ To find the inverse function we swap x and y: $$x=y^2-10y+24.$$ Completing the square: $$x=(y-5)^2-1,$$ from which we obtain: $$f^{-1}(x)=5\pm \sqrt{x+1}.$$ I have graphed this function and its inverse here:

https://www.desmos.com/calculator/sb7cj1yest

It will be noted that on the inverse the original function's x-intercepts at (4,0) and (6,0) become y intercepts at (0,4) and (0,6) and the respective turning points are at (5,-1) and (-1,5). Domain and range are also interchanged - range ##y \ge -1## on the function becomes domain ##x \ge -1## on the inverse. I have avoided referring to "inverse function" because technically this inverse is not a function. For x>1 there are two y values for each x value.
 
Last edited:
  • Like
Likes ChiralSuperfields
  • #12
neilparker62 said:
I would say that quite simply it's because a function and its inverse are symmetrical about the line y=x.
Yes I tell my pupils to check also using this method :)
 
  • Like
Likes ChiralSuperfields
  • #13
I think the main reason that people swap the variables is to keep the traditional domain variable input as 'x' and the traditional range variable as 'y', for both the function and its inverse. That is fine in a non-application scenario, where the meanings of the input and output are not determined and the only thing 'x' and 'y' mean are input and output, respectively. In general applications of mathematics, that would not be a good thing to do, but IMO there is very little risk of a person swapping variables in that situation, regardless of how it was presented in math class.
 
  • Like
Likes ChiralSuperfields and neilparker62
  • #14
neilparker62 said:
At risk of running against the grain of this thread, I would say that quite simply it's because a function and its inverse are symmetrical about the line y=x.
And this is the reason that most Precalc textbooks present the graphs of a function and its inverse. However, as @FactChecker says below, it makes absolutely no sense to write a function and its inverse as functions of the same variable in, for example, functions that do conversions from one kind of unit to another.
FactChecker said:
I think the main reason that people swap the variables is to keep the traditional domain variable input as 'x' and the traditional range variable as 'y', for both the function and its inverse. That is fine in a non-application scenario, where the meanings of the input and output are not determined and the only thing 'x' and 'y' mean are input and output, respectively.
Along the lines of what I mentioned before, once you get to integration problems, and you need to change the variable of integration, you often need to get the inverse of the integrand function, and it makes no sense whatever to switch the x and y variables.
 
  • Like
Likes ChiralSuperfields and FactChecker

1. What is the purpose of interchanging x and y for inverse functions?

The purpose of interchanging x and y for inverse functions is to find the inverse function of a given function. This allows us to solve for the original input (x) when given the output (y) and vice versa.

2. How do you interchange x and y for inverse functions?

To interchange x and y for inverse functions, we simply switch the variables in the original function. For example, if the original function is f(x), the inverse function would be written as f-1(y).

3. What is the relationship between a function and its inverse?

The relationship between a function and its inverse is that they "undo" each other. In other words, the inverse function reverses the effects of the original function. For example, if the original function is f(x) = 2x, the inverse function would be f-1(x) = x/2.

4. Can every function have an inverse?

No, not every function has an inverse. For a function to have an inverse, it must pass the horizontal line test, meaning that every horizontal line intersects the function at most once. If a function fails this test, it does not have an inverse.

5. How can interchanging x and y for inverse functions be useful in real-life applications?

Interchanging x and y for inverse functions can be useful in various real-life applications, such as in finance, physics, and engineering. For example, in finance, inverse functions can be used to calculate compound interest rates or to convert currency. In physics, they can be used to solve for unknown variables in equations. In engineering, they can be used to design and optimize systems.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
7
Views
407
  • Precalculus Mathematics Homework Help
Replies
15
Views
650
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
19
Views
3K
  • Precalculus Mathematics Homework Help
Replies
10
Views
889
  • Precalculus Mathematics Homework Help
Replies
11
Views
2K
  • Precalculus Mathematics Homework Help
Replies
12
Views
1K
  • Precalculus Mathematics Homework Help
Replies
9
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
Back
Top