Integral

 

Description

Minimum Origin Version Required: 8.6 SR0

This function performs one dimension integration, and returns the integral value of:

\int_{LowerLimit}^{UpperLimit} f(t, arg1, arg2, ...)dt

And the function is called as the below form:

integral(integrandName, LowerLimit, UpperLimit [, arg1, arg2, ...])

Where integrandName here is the function name of the integrand f(t, arg1, arg2, ...), LowerLimit and UpperLimit can be used "-inf" and "+inf" as negative infinity and positive infinity respectively.

Notes: If there are discontinuous points or a sharp peak in the integral interval for the integral function, that may introduce dis-converge problem, in such situation we suggest user divide the integral interval into several parts to add refined sub-intervals around these points.

Syntax

double Integral(integrandName, LowerLimit, UpperLimit [, arg1, arg2, ...])

Parameters

integrandName

The name of the defined function to be integrated.

LowerLimit

The lower limit of integral, "-inf" can be used as negative infinity.

UpperLimit

The upper limit of integral, "+inf" can be used as positive infinity.

arg1, arg2, ...

The arguments defined in the integrand.

Return

Return the integral value of specified integrand.

Example

// define quadratic equation as integrand
function double QuadraticEq(double x, double a, double b, double c) {
        return a+b*x+c*x^2;
}

// integrate quadratic equation
Integral(QuadraticEq, 1, 4, 1, 2, 3) = ;  // should return 81
Integral(QuadraticEq, -inf, +inf, 1, 2, 3) = ; // should return --, missing value

Algorithm

If LowerLimit is "-inf" or UpperLimit is "+inf", see: nag_1d_quad_inf_1 (d01smc)

Otherwise, see: nag_1d_quad_gen_1 (d01sjc).

See Also

Exp_integral, Elliptic_integral_rc, Elliptic_integral_rd, Elliptic_integral_rf, Elliptic_integral_rj, Cos_integral, Integrate