I have a function f[x] obtained by solving certain ODE. Thus, it is given as an interpolation function. I need to plot $\frac{dx}{df}$ as a function of $f$.
Below I will give a simple analytical example just to explain what I mean. Let $$f(x)=\arctan(x).$$ Then we have $$\frac{df}{dx}=\frac{1}{1+x^2},\quad \text{or} \quad \frac{dx}{df}=1+x^2.$$
Now we express $x$ in terms of $f$, i.e., $$x=\tan(f),$$ and substitute in the equation above: $$\frac{dx}{df}=1+x^2=1+\tan(f)^2.$$
Thus, given $f(x)=\arctan(x)$, I would like to get a plot of $$1+\tan(f)^2.$$
One naive way to do it is to parametrize $f$ and $\frac{dx}{df}$ in terms of $x$ and use ParametricPlot
ParametricPlot[{f[x], 1/f'[x]}, {x, -10, 10}, AspectRatio -> 1]
However, for my numerically defined function this does not work very well. Additionally, I would like to get the dependence in a functional form, the best would be again an interpolation function. How can I achieve this, maybe it is possible to formulate the problem as ODE and use NDSolve?


fi = InverseFunction[f]and then plotfi'(y)? – Roman Apr 17 '21 at 20:43ParametricPlotand suffers from similar numerical issues. – yarchik Apr 17 '21 at 20:45NDSolve, the dependent variables have to be functions of the same independent variable. So you cannot solve for both f(x) and x(f) at the same time as @Roman suggested. – Michael E2 Apr 18 '21 at 12:46DSolve[{y'[x] == 1/f'[y[x]], y[0] == 0}, y[x], x]in order to get the inverse of f. – yarchik Apr 18 '21 at 13:22f[y]at the same time. You have to solve separately, not “together.” – Michael E2 Apr 18 '21 at 13:24