I have obtained a result h(x) from NDSolve data. I can plot it

data = Import["C:\\Users\\...\\Desktop\\data.dat"];

enter image description here

Now I want to get the 2-nd order derivative of h(x) with respect to x, i.e. hxx, and the reverse of h(x), i.e. h^-1, in order to proceeding other calculation, such as, to plot the function of h^-2-hxx. Anyone can give me some guides or advice on this issue? Thank you very much!


1 Answer 1


Let's pretend this is your data

dat = Table[{x, 2 Sin[x]^2 + Cos[2 x]^2}, {x, 0, 2 \[Pi], 2 \[Pi]/100}]

Ok, not your data, but similar enough


Mathematica graphics

we create an Interpolation function

 f = Interpolation[dat]

and then just calculate derivatives and inverse

  , f''[x]
  , 1/f[x]
 , {x, 0, 2 \[Pi]}

Mathematica graphics

  • $\begingroup$ Hi, @rhermans. Thanks for your helpful and rapid reply! $\endgroup$
    – Enter
    Oct 15, 2014 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.