Evaluating integrals

Example

Another application of the Interpreter is numerical solution of arbitrary integrals.

Iprbook00000016.gif

Solution

We define a function f(x) to hold the function to be integrated; then we compute the integral using the help of TINA’s Integ function.

Function f(x);

Begin

f := sin(2*x)+Sqr(cos(x));

End;

Integ( f(s), -pi, pi, s )=[3.1416]

The syntax of the Integ command used above is,

Integ(Expression(),Limit1,Limit2,)

Expression() is the expression to be integrated; the left and right limits are Limit1, Limit2; and the variable of integration is .

There are a large number of built-in functions that you can use in the Interpreter. The formal parameters of some functions (such as sin, cos, exp, etc.) are complex. See the Appendix for details.