# Finding the inverse of a function

I am to solve for $$r(\rho)$$ given the function,

ρAsymp[r_, b_, q_] :=
1/(1 - q) Gamma[1/(1 - q)]/Gamma[(q - 2)/(q - 1)] r Sqrt[1 - (b/r)^(1 - q)]


This can be solved in a straightforward way by converting this into a quadratic equation and use Solve to find for the root corresponding to $$r(\rho)$$ for every value of $$q$$. But I have difficulty implementing the InverseFunction to this problem.

Can someone help me with this? Also, I want to scan $$r(\rho)$$ for all values of $$q<1$$, how can I implement this by using a Module?

• Recommend that you change your definition to \[Rho]Asymp[r_, b_, q_] := 1/(1 - q) Gamma[1/(1 - q)]/Gamma[(q - 2)/(q - 1)] r Sqrt[ 1 - (b/r)^(1 - q)] // FullSimplify // Evaluate which will be simplified to Sqrt[1 - (b/r)^(1 - q)]*r – Bob Hanlon Jan 15 '19 at 15:55
• I did not see that. Thank you for pointing out. Is there an efficient way of getting $r(\rho)$? for all allowed values of $q$? – user583893 Jan 16 '19 at 2:35
• Have you tried using FullSimplify on your function? The gamma functions all disappear and I get ρ = r*Sqrt[1-(b/r)^(1-q)]. Doesn't solve your problem though. – Roman Jun 14 '19 at 9:13

Looking at the examples in the documentaion you could do the following:

g = InverseFunction[Function[{r, b, q}, ρAsymp[r, b, q]], 1, 3]


which gives the inverse of ρAsymp[r, b, q], a function of 3 arguments, with respect to it's first argument r. Evaluation is then

g[1, 2, 3]


Sqrt[2]

The function g may now be used as a usual function.

• What about symbolically? If i only specify, $b$ and $q$ – user583893 Jan 15 '19 at 7:43
• @user583893 sadly that doesn't work for this particular function and my suggested solution. – gothicVI Jan 15 '19 at 8:12

This function shows a very different behavior depending on parameters. Decide which parameter combinations are relevant for you with the help of a graphical overview.

Manipulate[
ParametricPlot[{Sqrt[1 - (b/r)^(1 - q)] r /. q -> s/t, r}, {r, -10, 10},
AxesLabel -> {"rho", "r"}, AspectRatio -> 1],
{{b, -2}, -5, 5},
{{s, 3}, Join[Range[-5, 5], {1/Pi, Pi, 10 Pi, -1/Pi, -Pi, -10 Pi}]},
{t, Range[5]}]