<< simpson2 Numerical Integration Techniques (integtools)

Numerical Integration Techniques (integtools) >> Numerical Integration Techniques (integtools) > trapez

trapez

Evaluates the definite integral using Trapezoidal Method.

Calling Sequence

integral = trapez(a,b,n,f)

Parameters

a:

lower limit of integration

b:

upper limit of integration

n:

a real no. (denotes the no. of sub-intervals. Higher the value of n better the result.)

f:

The function that is to be integrated

<

Description

Returns the definite integral of a function using Trapezoidal Method.

Examples

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

See also

Bibliography

https://en.wikipedia.org/wiki/Trapezoidal_rule

Authors


Report an issue
<< simpson2 Numerical Integration Techniques (integtools)