SymbolicIntegration.jl

SymbolicIntegration.jl provides Julia implementations of symbolic integration algorithms.

The front-end (i.e., the user interface) uses Symbolics.jl. The actual integration algorithms are implemented in a generic way using AbstractAlgebra.jl. Some algorithms require Nemo.jl for calculations with algebraic numbers.

SymbolicIntegration.jl is based on the algorithms from the book

Manuel Bronstein, Symbolic Integration I: Transcentental Functions, 2nd ed, Springer 2005,

for which a pretty complete set of reference implementations is provided.

Currently, SymbolicIntegration.jl can integrate:

  • Rational functions
  • Integrands involving transcendental elementary functions like exp, log, sin, etc.

As in the book, integrands involving algebraic functions like sqrt and non-integer powers are not treated.

Note

SymbolicIntegration.jl is still in an early stage of development and should not be expected to run stably in all situations. It comes with absolutely no warranty whatsoever.

Installation

julia> using Pkg; Pkg.add("SymbolicIntegration")

Quick Start

using SymbolicIntegration, Symbolics

@variables x

# Basic polynomial integration (uses default RischMethod)
integrate(x^2, x)  # Returns (1//3)*(x^3)

# Rational function integration with complex roots
f = (x^3 + x^2 + x + 2)/(x^4 + 3*x^2 + 2)
integrate(f, x)  # Returns (1//2)*log(2 + x^2) + atan(x)

# Transcendental functions
integrate(exp(x), x)    # Returns exp(x)
integrate(log(x), x)    # Returns -x + x*log(x)

# Complex root integration (arctangent cases)
integrate(1/(x^2 + 1), x)  # Returns atan(x)

# Method selection and configuration
integrate(f, x, RischMethod())  # Explicit method choice
integrate(f, x, RischMethod(use_algebraic_closure=true))  # With options

Integration Methods

SymbolicIntegration.jl provides multiple integration algorithms through a flexible method dispatch system:

RischMethod (Default)

The complete Risch algorithm for elementary function integration:

  • Exact results: Guaranteed correct symbolic integration
  • Complex roots: Produces exact arctangent terms
  • Complete coverage: Rational and transcendental functions
  • Configurable: Options for performance vs completeness
# Default method
integrate(f, x)  

# Explicit method with options
integrate(f, x, RischMethod(use_algebraic_closure=true))

Future Methods

The framework supports additional integration algorithms:

  • HeuristicMethod: Fast pattern-matching integration
  • NumericalMethod: Numerical integration fallbacks
  • SymPyMethod: SymPy backend compatibility

→ See complete methods documentation

Algorithm Coverage

The RischMethod implements the complete suite of algorithms from Bronstein's book:

  • Rational Function Integration (Chapter 2)

    • Hermite reduction
    • Rothstein-Trager method for logarithmic parts
    • Complexification and real form conversion
  • Transcendental Function Integration (Chapters 5-6)

    • Risch algorithm for elementary functions
    • Differential field towers
    • Primitive and hyperexponential cases
  • Algebraic Function Integration (Future work)

    • Currently not implemented

Contributing

We welcome contributions! Please see the Symbolics.jl contributing guidelines.

Citation

If you use SymbolicIntegration.jl in your research, please cite:

@software{SymbolicIntegration.jl,
  author = {Harald Hofstätter and contributors},
  title = {SymbolicIntegration.jl: Symbolic Integration for Julia},
  url = {https://github.com/JuliaSymbolics/SymbolicIntegration.jl},
  year = {2023-2025}
}

Table of Contents