Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
    
That's just the derivative you want; try f'[1.5]. –  J. M. May 31 '13 at 1:58
    
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'. –  Mark McClure May 31 '13 at 2:04
    
I know it's the derivative. I want my students to find a derivative with a limit. –  user7716 May 31 '13 at 2:16
    
In general, interpolated functions seem fussy compared to user defined functions. –  user7716 May 31 '13 at 2:16
2  
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. –  Daniel Lichtblau May 31 '13 at 3:12

1 Answer 1

up vote 0 down vote accepted

Try:

<< NumericalCalculus`
f = Interpolation[Table[{x, x  x}, {x, 1, 5}]];
NLimit[(f[3 + h] - f[3])/h, h -> 0]
(*
 6
*)
share|improve this answer
    
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. –  user7716 May 31 '13 at 2:48
    
I still get errors, but I am at least getting an answer along with the errors now. Thank you! –  user7716 May 31 '13 at 2:53
    
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 –  user7716 May 31 '13 at 2:56
    
@user, because NLimit[] is not built-in, and it is in the NumericalCalculus` package which needs to be explicitly loaded... –  J. M. May 31 '13 at 4:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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