The link provided by @george2079 in the comments will be very useful if you run into more technical problems. I'm going to assume that it's all plain sailing, and just go through how integrating from data can work using Interpolation
.
Here's some fake data with the same structure as yours:
mydata = {#, Sin[#^2]} &@RandomReal[π, 100];
which gives you a list of x-values and a list of function values (which I'm pretending is Sin[x^2]
). Without an explicit expression for your function, you'll have to approximate the integral somehow. One straightforward way of doing this is with an InterpolatingFunction
.
infun = Interpolation[Transpose[mydata]];
Show[ListPlot[Transpose[mydata]],
Plot[infun[x], Evaluate@Flatten@{x, infun["Domain"]}]]

Then you can Integrate
infun
, using the domain stored in the InterpolatingFunction
Integrate[infun[x], Evaluate@Flatten@{x, infun["Domain"]}]
(* 0.788024 *)
Compare with the actual function
Integrate[Sin[x^2], Evaluate@Flatten@{x, infun["Domain"]}]
(* 0.788037 *)
The discrepancy is due to the fact that infun
is an approximation. The more data points you have, the more accurate it will be. Obviously.
Update: As @anderstood points out, you can also implement a straighforward rectangular rule on the sorted data:
mydata = {#, Sin[#^2]} &@Sort@RandomReal[\[Pi], 100];
xlist = Differences[mydata[[1]]];
Total[xlist mydata[[2, ;; -2]]] (* forward *)
Total[xlist mydata[[2, 2 ;; ]]] (* backward *)
(* 0.76924
0.808697 *)
which may not be quite as accurate, but improves greatly for large data sets and is a couple of orders of magnitude faster.
RandomReals
, or pastebin.com), 3) you don't want to integrate, you want to approximate the integral, using data and an approximation scheme (which one? trapezoidal, etc.). $\endgroup$