Integrate
Integrate( y,x,i )
Returns the result of applying the trapezoidal rule of integration to the set of points (x_i,y_i>
.
Integrate computes the cumulative integral across «i», returning a value with the same number of dimensions as «x» and «y». Compare Integrate to Area.
When either «x» or «y» is an index, the index parameter «i» may be safely omitted.
Library
- Array functions
Examples
Let:
The integral of this function is given by:
Note that because the index r was defined from -20 to 20, Integrate treats all values for x<-20 as being zero.
Handling of Null values
New to Analytica 4.2
The «x» and «y» arrays must contain numbers, but may also contain Null values. Any point having «x»=Null is entirely ignored and has no impact on the result. When a point has a numeric «x» but a Null-valued «y», this is treated as a gap in the function, and the trapezoid extending from the previous «x» to the next «x» is not counted in the integration.
Suppose, for example, that:
In this example, the curve denoted by (x,y) has a gap at x=3. Integrate treats this as if it were the function shown here:
In this case, the area to the left of x=1 is 0, the area to the left of x=2, x=3 or x=4 is 1.5, and the area to the left of x=5 is 1.5+4.5 = 6.
Enable comment auto-refresher