Your problem is that InverseFunction
is choosing the "wrong" branch for the inverse. To account for this, you can use ConditionalExpression
to pick the branch used by InverseFunction
. For your example:
f[x_] := x + 2^(1/3) x^(4/3)
if = InverseFunction[ConditionalExpression[f[#], #>0]&]
Rather than finding the inverse of Composition[f, f]
, it will be easier for Mathematica to use Composition[if, if]
. So:
g = Composition[if, if];
Now, unfortunately, there is an issue when using Derivative
on the above Composition
object, so I will use the following workaround to obtain g'
:
gp = (Composition[h, h]') /. h -> if;
Let's do a couple quick numerical checks:
(* inverse check *)
Composition[f, f][g[1.]]
1.
(* derivative check *)
gp[1.]
10^6 (g[1. + 10^-6] - g[1.])
0.20484
0.20484
Looks good. Now, we can define k
:
k[x_] := x^(1/3) gp[x]/g[1]
Finally, a plot:
Plot[k[x], {x, 0, 1}, PlotRange->All]
k[x]
is complex. UsePlot[Evaluate@ReIm@k[x], {x, 0, 1}, WorkingPrecision -> 15]
instead. $\endgroup$