Uses and Current limitations¶
Integration¶
One can perform integrations using holonomic functions by following these steps:
Convert the integrand to a holonomic function.
Now integrate the holonomic representation of the function.
Convert the integral back to expressions.
Examples¶
>>> from sympy.abc import x, a
>>> from sympy import sin
>>> from sympy.holonomic import expr_to_holonomic
>>> expr_to_holonomic(1/(x**2+a), x).integrate(x).to_expr()
atan(x/sqrt(a))/sqrt(a)
>>> expr_to_holonomic(sin(x)/x).integrate(x).to_expr()
Si(x)
As you can see in the first example we converted the function to holonomic, integrated the result and then converted back to symbolic expression.
Limitations¶
1. Converting to expressions is not always possible. The holonomic function
should have a hypergeometric series at x0
.
2. Implementation of converting to holonomic sequence currently doesn’t support
Frobenius method
when the solutions need to have to_expr()
fails.
3. There doesn’t seem to be a way for computing indefinite integrals, so integrate()
basically computes
>>> expr_to_holonomic(sin(x)).integrate(x).to_expr()
1 - cos(x)
>>> sin(x).integrate(x)
-cos(x)
The indefinite integral of