Learn How to Invert a Function with Mathematica for y = x^2

  • Mathematica
  • Thread starter kent davidge
  • Start date
  • Tags
    Function
In summary, when working with the function ##y = x^2##, it is important to note that it does not have an inverse that is itself a function. This is because for a function to have an inverse, it must be one-to-one. However, the Solve function in Mathematica can find and report both possible solutions for the inverse, which in this case is ##x = \pm \sqrt y##.
  • #1
kent davidge
933
56
Suppose I have ##y = x^2##. By inverse, I mean ##x = \pm \sqrt y##. How can I get Mathematica to do that?
 
Physics news on Phys.org
  • #3
kent davidge said:
Suppose I have ##y = x^2##. By inverse, I mean ##x = \pm \sqrt y##. How can I get Mathematica to do that?
Technically speaking, ##y = x^2## doesn't have an inverse that is itself a function. For a function f to have an inverse, f must be one-to-one. Your example function fails this test because for each number x in the domain that maps to ##x^2##, -x also maps to the same value.
 
  • Like
Likes kent davidge
  • #4
Mark44 said:
Technically speaking, ##y = x^2## doesn't have an inverse that is itself a function. For a function f to have an inverse, f must be one-to-one. Your example function fails this test because for each number x in the domain that maps to ##x^2##, -x also maps to the same value.
Solve finds and reports both.
 
  • #5
Dale said:
Solve finds and reports both.
Right. I checked with wolframalpha, which is sort of the online version of Mathematica.
 

1. How do I use Mathematica to invert a function?

To invert a function in Mathematica, you can use the InverseFunction command. For example, to invert the function y = x^2, you would use the command InverseFunction[#^2 &].

2. Can I invert a function with multiple variables?

Yes, you can invert a function with multiple variables using the InverseFunction command. Just make sure to specify all the variables in the function. For example, to invert the function y = x^2 + 2x + 1, you would use the command InverseFunction[#^2 + 2 # + 1 &].

3. How do I plot the inverted function?

To plot the inverted function in Mathematica, you can use the Plot command. For example, to plot the inverse of y = x^2, you would use the command Plot[InverseFunction[#^2 &][x], {x, -5, 5}].

4. What if the function I want to invert is not one-to-one?

If the function you want to invert is not one-to-one, you can still use the InverseFunction command, but you will need to specify a specific branch of the inverse function. For example, if you want to invert y = sin(x), you can use the command InverseFunction[Sin[#] &, 1] to specify the principal branch of the inverse function.

5. Can I use Mathematica to find the derivative of the inverted function?

Yes, you can use Mathematica to find the derivative of the inverted function using the D command. For example, to find the derivative of the inverted function of y = x^2, you would use the command D[InverseFunction[#^2 &][x], x].

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
140
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
768
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
910
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
901
Back
Top