# Numerical Inversion of an incomplete beta function expressed as gauss hypergeometric function using Mathematica

I am currently working with this hypergeometric function ${_2}F_1$,

$\rho(r)=\frac{2b}{1-q}(1-(\frac{b}{r})^{1-q})^{\frac{1}{2}}{_2}F_1(\frac{1}{2},1-\frac{1}{q-1},\frac{3}{2},1-(\frac{b}{r})^{1-q})$

I have just started learning and using Mathematica and I just want to ask if I can use Mathematica to construct and implement a simple routine to numerically invert the function $\rho(r)$ into $r(\rho)$? Note that $-\infty<q<1$, and $r,b>0$. Also, at $r=b$, $\rho=0$.

I have already tried the following routine

r[\rho_] := r /. Solve[\rho == (b/(1 - q)) (1 - (b/r)^(1 - q))^(1/2)/(1/
2) Hypergeometric2F1[1/2, 1 - 1/(q - 1), 1/2 + 1,
1 - (b/r)^(1 - q)], r][]
r

• What have you tried? Did you search the documentation? – rhermans Aug 21 '18 at 14:20
• I have tried the InverseFunction command but nothing happens. – user583893 Aug 21 '18 at 14:29
• Try to put yourself in our position, there is very little we can do without seeing the specific code you have used and an something more information rich than "nothing happens". Please read my first comment and follow the links. Please share the code that defines $\rho(r)$ – rhermans Aug 21 '18 at 14:43

\[Rho][r_, b_, q_] := (2*b/(1 - q))*(1 - (b/r)^(1 - q))^(1/2)*
Hypergeometric2F1[1/2, 1 - 1/(q - 1), 3/2, 1 - (b/r)^(1 - q)]
R = InverseFunction[
Function[{r, b, q}, (2*b/(1 - q))*(1 - (b/r)^(1 - q))^(1/2)*
Hypergeometric2F1[1/2, 1 - 1/(q - 1), 3/2, 1 - (b/r)^(1 - q)]], 1,
3]
{Plot[\[Rho][r, 1, -2], {r, 0, 3}],
Plot[R[x, 1, -2], {x, 0, 3}, PlotRange -> All]} • This works. Thank you. – user583893 Aug 23 '18 at 11:10