I need this to calculate the area from the function I’m going to calculate the area between the function and the X-axis.
Answer
I understand that you want to determine the area between a function f(x) and the x-axis, I suppose between two boundaries x = a and x = b. That’s just the integral of f(x) between a and b as you normally learned in secondary.
If you do not have a formula for the function f(x), but only a number of points f(xi) there are so-called numerical methods that can approximate the integral well.
Determining an unambiguous function prescription is then not possible because of course an infinite number of functions pass through those given points. What one can do is between the points [xi,f(xi)] interpolate in some way. The numerical methods all do this in one way or another.
The most famous is Simpson’s method, which you can find in dozens of places on the internet
to find, see for example: http://nl.wikipedia.org/wiki/Regel_van_Simpson
This rule requires you to know the function values ​​of a set of evenly distributed (i.e. equidistant) points between a and b. The method actually draws a small parabola between three successive points and integrates its area. The area under all those parabolas together then normally forms a very good approximation for the area under the function on which the points lie. The trapezoidal rule is simpler but less good, this rule interpolates linearly between two consecutive points.

Answered by
prof.dr. Paul Hellings
Department of Mathematics, Fac. IIW, KU Leuven

Old Market 13 3000 Leuven
https://www.kuleuven.be/
.