Evaluates the definite integral using Trapezoidal Method.
integral = trapez(a,b,n,f)
lower limit of integration
upper limit of integration
an even no. (denotes the no. of sub-intervals. Higher the value of n better the result.)
The function that is to be integrated
Returns the definite integral of a function using Trapezoidal Method.
deff('a=f(x)','a=x*x') // define a function f which returns x^2 integral = trapez(0,2,600,f) // evaluates the integral of x^2 from 0 to 2 | ![]() | ![]() |
https://en.wikipedia.org/wiki/Trapezoidal_rule