# Storage of interpolated data

I successfully imported some optical data to Mathematica, which I need to interpolate to use it as a proper function. The command data=Interpolation[] was quite helpful, but know I'm in doubt whether it is the best way to define a function f[x_]:=data[x] when the function will later be called upon in a numerical integration with NIntegrate[].

What is the best way to store the interpolated data in terms of computational time when using it later in NIntegrate[]? Any advice is highly appreciated.

Thank you!

• There's no reason you can't NIntegrate[] an InterpolationFunction – Feyre Aug 9 '16 at 15:12
• Yes, but compared to a non-interpolated function it takes much more computational time. That's the reason why I was wondering whether there is a more efficient way to store the interpolated values. – Display Name Aug 9 '16 at 15:15
• I don't think that's true, at least not when you always use NIntegrate[] – Feyre Aug 9 '16 at 15:18
• Ok, so if there is no other way that is more efficient I have to stick to this method and see how I can otherwise improve my code. – Display Name Aug 9 '16 at 15:19
• Note that you can Integrate an InterpolatingFunction, since it is a piecewise-polynomial function and therefore easy to piecewise-integrate. (I learned that here somewhere.) – march Aug 9 '16 at 15:36