InverseFunction
InverseFunction[f] yields a function that, given an argument y, gives a result x for which y==f[x] holds. That is to say:
f[x_] = x + x^2;
g = InverseFunction[f];
g[6]
-3
f[-3]
6
Take care here because, as always with inverse functions, it's not necessarily the case that $f^{-1}(f(x))=x$. Here, f maps both 2 and -3 to 6, but the inverse can take you back to only one value. Mathematica choose to map back to 3 in this case (and throws a warning message).
Pure functions
A pure function is specified in Mathematica using a Slot (#) and & syntax.
#^2+1&
In this example is a function with one argument. It squares its argument and adds 1. It can be used directly on an argument like so:
#^2 + 1 &[2]
5
or by first assigning it to a function name and then applying it to an argument:
h = #^2 + 1 &;
h[2]
5
Instead of plain Slot you can also use multiple arguments that are numbered like #1, #2, #3 etc.
m = #1/Cosh[#2] &;
m[5, 3]
5 Sech[3]
Pure functions can have inverses defined in the same way as above.
InverseFunction[#^2 &][2]
During evaluation of In[46]:= InverseFunction::ifun: Inverse functions are being used. Values may be lost for multivalued inverses. >>
-Sqrt[2]
The rather complex InverseFunction in the question
If we study the InverseFunction in the question:
InverseFunction[-((Log[Sqrt[#1] y[r] + Sqrt[y[r]] Sqrt[x[r] + #1 y[r]]] x[r])/
y[r]^(3/2)) + (Sqrt[#1] Sqrt[x[r] + #1 y[r]])/y[r] &][-Sqrt[2]t + C[1]]
You can see that it can be written as follows:
p = -((Log[Sqrt[#1] y[r] + Sqrt[y[r]] Sqrt[x[r] + #1 y[r]]] x[r])/
y[r]^(3/2)) + (Sqrt[#1] Sqrt[x[r] + #1 y[r]])/y[r] &;
q = -Sqrt[2]t + C[1]
p is admittedly a baroque beast, but it's just a pure function like the simple #^2 + 1 & above. It is a function of one argument (I only see #1's).
And with
r=InverseFunction[p]
the rule outputs of your DSolve are just
r[q],
The inverse function acting on the argument q, where C[1] is an unspecified constant that is part of the solution because no initial or boundary condition was given.
InverseFunctionin the documentation? What about#? – rcollyer Dec 21 '12 at 15:38InverseFunction[pureFunction][Sqrt[2] t + C[1]]. Any thoughts on what it is doing? Hint: what doesInverseFunction[pureFunction]return? – rcollyer Dec 21 '12 at 15:48f[a][b]. It is possible to define such things directly, but more simply they should be thought of as(f[a])[b]. So,f[a]returns something whichbis then passed to. Iff = 5, you'd get5[b]which is nonsensical, but if you could return a function ... – rcollyer Dec 21 '12 at 16:22