I have a data set and I want to integrate it. I have plotted the data with TGraph and using TGraph::Integral(), I calculate the integral but I have some doubts about the result. In order to understand if I am proceeding on the right way, I have executed a test: The integral of X^2 between 2 and 8 (for example).
First, I used:
TF1* func=new TF1("func","x^2",1,8); double integral=func->Integral(1.,8.);
and the results is right, ~170.333.
Now, I used:
TGraph* grap=new TGraph(func); double integr=grap->Integral();
and the result is ~55.4631, it isn’t the result I expected. I don’t know if I am doing something wrong or …??
Thanks in advance,