I have an interpolated function

f = Interpolation[data]

I would like to calculate limits such as

Limit[(f[1.5 + h] - f[1.5])/h, h -> 0]

I just get errors.

  • $\begingroup$ That's just the derivative you want; try f'[1.5]. $\endgroup$
    – J. M.'s torpor
    May 31 '13 at 1:58
  • $\begingroup$ Limit is a purely algebraic tool. You could try NLimit from the NumericalCalculus package. I concur with J.M., however, that your specific example would be best approached with f'. $\endgroup$ May 31 '13 at 2:04
  • $\begingroup$ I know it's the derivative. I want my students to find a derivative with a limit. $\endgroup$
    – user7716
    May 31 '13 at 2:16
  • $\begingroup$ In general, interpolated functions seem fussy compared to user defined functions. $\endgroup$
    – user7716
    May 31 '13 at 2:16
  • 2
    $\begingroup$ While I agree it might be a reasonable thing to do, at this time Limit is not going inside the InterpolatingFunction to extract a local interpolant polynomial. $\endgroup$ May 31 '13 at 3:12


<< NumericalCalculus`
f = Interpolation[Table[{x, x  x}, {x, 1, 5}]];
NLimit[(f[3 + h] - f[3])/h, h -> 0]
  • $\begingroup$ Thanks, this is not working for me. I am not sure how to copy and paste my code into a comment to show you. I am trying to figure it out. $\endgroup$
    – user7716
    May 31 '13 at 2:48
  • $\begingroup$ I still get errors, but I am at least getting an answer along with the errors now. Thank you! $\endgroup$
    – user7716
    May 31 '13 at 2:53
  • $\begingroup$ Can you explain why I needed the <<NumericalCalculus`? Isn't NLimit already defined without any special packages? That line is what seems to make the difference $\endgroup$
    – user7716
    May 31 '13 at 2:56
  • $\begingroup$ @user, because NLimit[] is not built-in, and it is in the NumericalCalculus` package which needs to be explicitly loaded... $\endgroup$
    – J. M.'s torpor
    May 31 '13 at 4:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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