Contents Previous Next Subchapters Current Chapters-> trapz gaussq quad2d gaussq2d gaussleg quadint int2inf ode4rk expmat ode45rk odepade odestiff Parent Chapters-> Omatrix6 integration int2inf Search Tools-> contents reference index search

Numerical Integration to Infinity
 Syntax `int2inf(function `fvec`, `low`, `eps`)` See Also gaussq , gaussleg

Description
Returns an approximation for ```       +inf      /      | f(x) dx      /      low ```where low is a real or double-precision scalar. Given a column vector xvec of length n and with the same type as low, the function fvec returns the column vector ```      /          \      | f(xvec ) |      |       1  |      | f(xvec ) |      |       2  |      |    ...   |      | f(xvec ) |      \       n  / ```The relative accuracy for the integral is specified by eps which is a scalar with the same type as low . If the approximation converges, the return value is a scalar with the same type as low. Otherwise, the return value has type equal to `"novalue"`.

Example
If you enter ```      clear      function fvec(xvec) begin           return exp(-xvec)      end      low  = 0.      eps  = 1e-5      int2inf(function fvec, low, eps) ``` O-Matrix will reply ```      1 ``` which is equal to the integral of `exp(-x)` from zero to infinity.

Reference
This integration method assumes that ```             2      f(x)  x  -->  0  as x --> +infinity ```