# JMathLabTutorial:Indefinite Integrals

# Indefinite Integral

**integrate(function, x)** integrates a function with respect to the symbolic variable x. The program recognizes all built-in functions and polynomials:

Let us consider an example which shows the original function and its integral in a single 2D plot:

All trigonometric functions are also supported. Run this script to see the answer.

If function is rational (i.e. quotient of two polynomials, whose coefficients do not depend on x)) we use the standard approach: Separate a polynomial part, then separate a square free part using Horowitz' [11] method, and finally integrate the rest using partial fractions. The final terms are collected to avoid complex expressions.

Expressions of type [math]g(f(x))\cdot f'(x)[/math] and [math]f'(x) / f(x)}[/math] are detected:

Substitutions of type $(a\cdot x+b)$ are applied:

Products polynomial(x)*f(x) are fed through partial integration. This solves all cases where $f$ is one of exp, sin , cos , log , atan.

All trig and exp-functions are normalized. This solves any expression, which is the product of any number and any type of exponentials and trigonometric functions, and some cases of rational expressions of trig- and exp-functions

The special case $\sqrt{ax^2+bx+c}$ is implemented:

Clever substitutions may be supplied manually through subst(). If all fails, integrate numerically using quad or romberg. The symbolic variable may be omitted if it is the main variable of expression. Integration can be quickly verified using diff() on the result.