API Reference
Main Functions
SymbolicIntegration.integrate — Functionintegrate(f, x)Compute the symbolic integral of expression f with respect to variable x using all available methods.
Arguments
f: Symbolic expression to integrate (Symbolics.Num)x: Integration variable (Symbolics.Num)
Examples
julia> using SymbolicIntegration, Symbolics
julia> @variables x
julia> integrate(2x)
x^2
julia> integrate(sqrt(x))
┌ Warning: NotImplementedError: integrand contains unsupported expression sqrt(x)
└ @ SymbolicIntegration ~/.julia/dev/SymbolicIntegration.jl_official/src/methods/risch/frontend.jl:826
> RischMethod failed returning ∫(sqrt(x), x)
> Trying with RuleBasedMethod...
┌-------Applied rule 1_1_1_1_2 on ∫(sqrt(x), x)
| ∫(x ^ m, x) => if
| !(contains_var(m, x)) &&
| !(eq(m, -1))
| x ^ (m + 1) / (m + 1)
└-------with result: (2//3)*(x^(3//2))
(2//3)*(x^(3//2))
julia> integrate(abs(x))
┌ Warning: NotImplementedError: integrand contains unsupported expression abs(x)
└ @ SymbolicIntegration ~/.julia/dev/SymbolicIntegration.jl_official/src/methods/risch/frontend.jl:826
> RischMethod failed returning ∫(abs(x), x)
> Trying with RuleBasedMethod...
No rule found for ∫(abs(x), x)
> RuleBasedMethod failed returning ∫(abs(x), x)
> Sorry we cannot integrate this expression :(
integrate(f, method)If f contains only one symbolic variable, computes the integral of f with respect to that variable, with the specified method, or tries all available methods if not specified.
integrate(f, x, method::AbstractIntegrationMethod=RischMethod(); kwargs...)Compute the symbolic integral of expression f with respect to variable x using Risch integration method.
Arguments
f: Symbolic expression to integrate (Symbolics.Num)x: Integration variable (Symbolics.Num)method: Integration method to use (AbstractIntegrationMethod, default: RischMethod())
Keyword Arguments
- Method-specific keyword arguments are passed to the method implementation
Returns
- Symbolic expression representing the antiderivative (Symbolics.Num)
Examples
# Explicit method with options
integrate(1/(x^2 + 1), x, RischMethod(use_algebraic_closure=true)) # atan(x)
# Method configuration
risch = RischMethod(use_algebraic_closure=false, catch_errors=true)
integrate(exp(x), x, risch) # exp(x)integrate(f, x, method::AbstractIntegrationMethod=RuleBasedMethod(); kwargs...)Compute the symbolic integral of expression f with respect to variable x using rule based method.
Arguments
f: Symbolic expression to integrate (Symbolics.Num)x: Integration variable (Symbolics.Num)method: Integration method to use
Returns
- Symbolic expression representing the antiderivative (Symbolics.Num) (the +c is omitted)
Examples
julia> integrate(1/sqrt(1 + x), x, RuleBasedMethod())
┌-------Applied rule 1_1_2_1_33 (change of variables):
| ∫((a + b * v ^ n) ^ p, x) => if
| !(contains_var(a, b, n, p, x)) &&
| (
| linear(v, x) &&
| v !== x
| )
| (1 / ext_coeff(v, x, 1)) * substitute(∫{(a + b * x ^ n) ^ p}dx, x => v)
└-------with result: ∫1 / (u^(1//2)) du where u = 1 + x
┌-------Applied rule 1_1_1_1_2 on ∫(1 / (x^(1//2)), x)
| ∫(x ^ m, x) => if
| !(contains_var(m, x)) &&
| m !== -1
| x ^ (m + 1) / (m + 1)
└-------with result: (2//1)*(x^(1//2))
(2//1)*sqrt(1 + x)
julia> rbm = RuleBasedMethod(verbose=false)
julia> integrate(1/sqrt(1 + x), x, rbm)
(2//1)*sqrt(1 + x)Integration Methods
Available Methods
SymbolicIntegration.RischMethod — TypeRischMethod <: AbstractIntegrationMethodRisch algorithm for symbolic integration of elementary functions.
Fields
use_algebraic_closure::Bool: Whether to use algebraic closure for complex roots (default: true)catch_errors::Bool: Whether to catch and handle algorithm errors gracefully (default: true)
Method Traits
SymbolicIntegration.method_supports_rational — Functionmethod_supports_rational(method::RischMethod)Check if the integration method supports rational function integration. Returns true for RischMethod and RuleBasedMethod.
SymbolicIntegration.method_supports_transcendental — Functionmethod_supports_transcendental(method::RischMethod)Check if the integration method supports transcendental function integration. Returns true for RischMethod and RuleBasedMethod.
Algorithm Overview
SymbolicIntegration.jl implements the complete symbolic integration algorithms from Manuel Bronstein's book "Symbolic Integration I: Transcendental Functions".
Supported Function Classes
- Polynomial functions: ∫xⁿ dx
- Rational functions: ∫P(x)/Q(x) dx using Rothstein-Trager method
- Exponential functions: ∫exp(f(x)) dx using Risch algorithm
- Logarithmic functions: ∫log(f(x)) dx using integration by parts
- Trigonometric functions: Transformed to exponential form
Algorithm Components
The package includes implementations of:
- Hermite reduction for rational functions
- Rothstein-Trager method for logarithmic parts
- Risch algorithm for transcendental functions
- Differential field tower construction
- Complex root finding for arctangent terms
Internal Structure
The package is organized into several algorithm modules:
rational_functions.jl: Rational function integration algorithmstranscendental_functions.jl: Risch algorithm implementationdifferential_fields.jl: Differential field operationscomplex_fields.jl: Complex number field handlingfrontend.jl: User interface and expression conversion
Error Handling
The package defines custom exception types:
NotImplementedError: For unsupported function typesAlgorithmFailedError: When no elementary antiderivative existsAlgebraicNumbersInvolved: When algebraic numbers complicate the result