Integration
In this lesson, we will learn about definite and indefinite integrals of single and multiple integrations.
We'll cover the following...
Integration is one of the two main operations of calculus, with its inverse operation, differentiation, being the other. Given a function of a real variable and an interval of the real line, the definite integral is denoted as:
Integrals are calculated with the integrate()
function. SymPy implements a combination of the Risch algorithm and an algorithm for computing integrals based on Meijer G-functions. These allow SymPy to compute a wide variety of indefinite and definite integrals.
Indefinite integrals #
Integration uses syntax similar to differentiation. For the indefinite integral, we specify the function and the variable with respect to which the integration is performed.
integrate(y, x)
The
integrate()
function does not add the constant of integration in the indefinite integral.
Let’s see an example of integrating a polynomial below:
from sympy import *def f(x):return (x**2 + x)x = Symbol('x')print(integrate(f(x), x))
SymPy allows for a range of integrals. Let’s see them one by ...