Java Math Engine: Integration


Symbolic integration can be performed on objects known to the system such as built-in functions, previously defined functions, variable and operations. The symbolic integration engine is not as powerful as the differentiation engine, simply because integration is not as easy. We will list below the kind of functions which can be integrated.

The operator which performs symbolic integration is int. There are three ways to use it:

  1. int(expr)
  2. int(expr, var)
  3. int(expr, var, val1, val2)

In the above explanation, expr denotes a valid mathematical expression, var denotes the variable of differentiation, val1 denoted the lower limit of integration and val2 denotes the upper limit of integration.

The meaning of each form of the int operator is given below:

Here are some examples:

  1. int(sin(x)) finds an anti derivative of sin(x).
  2. int(cos(t),t) finds an anti derivative of cos(t) with respect to t.
  3. int(sin(x),x,-pi/2,pi/2) finds the definite integral of sin(x) with respect to x, between -pi/2 and pi/2.

The following functions can be integrated:

  1. Linear functions.
  2. sin(expr), arcsin(expr), cos(expr), arccos(expr), tan(expr), arctan(expr), cot(expr), sec(expr), csc(expr), exp(expr), ln(expr), log(expr), log2(expr) and sqrt(expr) where expr is a linear function.
  3. Addition, subtraction and multiplication by a constant of functions from 1) and 2).