Hi(adsbygoogle = window.adsbygoogle || []).push({});

I have a data set of the form:

This data set is a probability density function (PDF), and I need to be able to integrate it from 0 to some x<22. I thought that I would use an interpolating function for this. However, there is a "gap" between 4 and 20, where the PDF is zero, but an interpolating function doesn't take that into account by itself (I think). Is there a smarter way of accounting for this other than manually inserting data points?Code (Text):data = {{0, 0}, {1, 1}, {2, 2}, {3, 20}, {4, 1}, {20, 1}, {21, 1}, {22, 0}};

The second problem is that ListInterpolation only takes a 1D-list. So I can only feed it the 2nd coordinate of the data points. However, I need somehow for the interpolation function to run from 0 to 22. I don't know how to do that.

I appreciate any help and suggestions.

Best regards,

Niles.

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematica: Interpolation Functions

**Physics Forums | Science Articles, Homework Help, Discussion**