# How to get the solution from inverse function

When I run *Mathematica* to get the solution of a differential equation it gives the result in terms of inverse function.

DSolve[y'[t] == ε/Sqrt[1 + k/y[t]^2], y[t], t]


My question is how can we extract the actual solution from the result without the inverse function or what will be an exact solution?

• Why do you think it's even possible? It looks like it's the same case as a simple y == x + Log[x] - there is a solution for x, but it's not elementary; it's just x == inverse of y. The thing is that you'd need to solve the output for #1 - that, given the square roots, logs etc., seems unlikely. – corey979 Jan 13 '17 at 13:16
• If you still didn't get it after corey979 comment, then probably you will get from here? mathematica.stackexchange.com/questions/16770/… or from here mathematica.stackexchange.com/questions/15978/… – zhk Jan 13 '17 at 15:18

You can treat the InverseFunction like a normal function, plot it, build the derivative ...

     dsol =
DSolve[y'[t] == \[CurlyEpsilon]/Sqrt[1 + k/y[t]^2] && y[0] == a, y, t]

(*   {{y ->
Function[{t},
InverseFunction[(1/Sqrt[k + #1^2])
Sqrt[1 +
k/#1^2] #1 (Sqrt[k] Log[#1] -
Sqrt[k] Log[k + Sqrt[k] Sqrt[k + #1^2]] + Sqrt[
k + #1^2]) &][
t \[CurlyEpsilon] + (1/Sqrt[a^2 + k])
a Sqrt[(a^2 + k)/
a^2] (Sqrt[a^2 + k] + Sqrt[k] Log[a] -
Sqrt[k] Log[k + Sqrt[k] Sqrt[a^2 + k]])]]}}    *)


    y[t_, \[CurlyEpsilon]_, k_, a_] = y[t] /. First[dsol]

Plot[Evaluate@y[t, 1/10, 2, 1], {t, 0, 100}]


    Plot[Evaluate[D[y[t, 1/10, 2, 1], t]], {t, 0, 100}]


In my opinion, the solution obtained by you is useless. It is difficult to work with. If I were you, I will use the ParametricNDSolve command, adding the parameter $a$ to $k,\epsilon$ in such a way:

sol = ParametricNDSolve[{Derivative[1][y][t] == \[Epsilon]/
Sqrt[1 + k/y[t]^2], y[0] == a},  y, {t, 0, 10}, {a, \[Epsilon], k}];
y1 = y[1, 0.1, 2] /.  sol;
y1[2] /. sol


1.11985

Plot[y1[t], {t, 0, 10}]


The above plot suggests a solution which is very close to linear.

• If you plot over a longer range ($0 < t < 100$, for example), you will find that the function is most assuredly not linear. It does look linear over the range you've plotted, but any function will look linear if you plot it over a small enough range. – Michael Seifert Jan 13 '17 at 16:13
• @ Michael Seifert : The numeric solution from my answer is reliable on $[0,10]$ only. The one is close to linear there. – user64494 Jan 13 '17 at 17:15
• Good point. Still, the solutions in general will not be fully linear; try plotting y[0.1, 0.1, 2] from t = 0 to t = 50 (after adjusting the time range). The solutions will be roughly linear when the solution satisfies $y(t) \gg \sqrt{k}$, which is the regime you plotted. (Also, they'll be roughly exponential when $y(t) \ll \sqrt{k}$.) – Michael Seifert Jan 13 '17 at 20:29
• @ Michael Seifert : The nonlinearity of the solutions is obvious. The ODE form clearly says the derivative is not constant. – user64494 Jan 13 '17 at 21:06