A pascal program that calculates the definite integral of a function given the upper and lower limits of the integral.
The method used is the Trapezoidal rule. By default it calculates the integral for the function f(x) = x². However, this method is applicable for any function just changing the function definition in the Pascal code.
It requires to install the Free Pascal Compiler (fpc):
$ fpc aproxintegral.pas
Now we can execute the binary file
$ ./aproxintegral