SymbolicIntegration.jl solves indefinite integrals (find primitives of functions) using one of the implemented algorithms: Risch method and Rule based method
julia> using SymbolicIntegration, Symbolics
julia> @variables x
julia> integrate(exp(2x) + 2x^2 + sin(x))
(1//2)*exp(2x) + (2//3)*(x^3) - cos(x)The first argument is the expression to integrate, second argument is the integration variable. If that's not specified, it will be guessed from the expression. The +c is omitted :)
You can explicitly choose a integration method like this:
risch = RischMethod(use_algebraic_closure=true, catch_errors=false)
integrate(f, x, risch)or like this:
rbm = RuleBasedMethod(verbose=true, use_gamma=false)
integrate(f, x, rbm)If no method is specified, first RuleBasedMethod will be tried, then RischMethod:
julia> integrate(abs(x);verbose=true)
No rule found for ∫(abs(x), x)
> RuleBasedMethod(use_gamma=false, verbose=true) failed, returning ∫(abs(x), x)
> Trying with RischMethod(use_algebraic_closure=false, catch_errors=true)...
> RischMethod(use_algebraic_closure=false, catch_errors=true) failed, returning ∫(abs(x), x)
> Sorry we cannot integrate this expression :(
∫(abs(x), x)Currently two methods are implemented: Risch algorithm and Rule based integration.
| feature | Risch | Rule based |
|---|---|---|
| rational functions | ✅ | ✅ |
| non integers powers | ❌ | ✅ |
| exponential functions | ✅ | ✅ |
| logarithms | ✅ | ✅ |
| trigonometric functions | ? | sometimes |
| hyperbolic functions | ✅ | sometimes |
| Nonelementary integrals | ❌ | most of them |
| Special functions | ❌ | ❌ |
| multiple symbols | ❌ | ✅ |
More info about them in the methods documentation
Complete symbolic integration using the Risch algorithm from Manuel Bronstein's "Symbolic Integration I: Transcendental Functions".
This method uses a large number of integration rules that specify how to integrate various mathematical expressions. There are now more than 3400 rules impelmented.
For information on using the package, see the stable documentation. Use the in-development documentation for the version of the documentation which contains the unreleased features.
If you use SymbolicIntegration.jl in your research, please cite:
@software{SymbolicIntegration.jl,
author = {Mattia Micheletta Merlin, Harald Hofstätter and Chris Rackauckas},
title = {SymbolicIntegration.jl: Symbolic Integration for Julia},
url = {https://github.com/JuliaSymbolics/SymbolicIntegration.jl},
year = {2023-2025}
}