Transcendental Function Integration
SymbolicIntegration.jl implements the Risch algorithm for integrating elementary transcendental functions.
Supported Functions
Exponential Functions
using SymbolicIntegration, Symbolics
@variables x
integrate(exp(x), x) # exp(x)
integrate(exp(2*x), x) # (1//2)*exp(2*x)
integrate(x*exp(x), x) # -exp(x) + x*exp(x)
Logarithmic Functions
integrate(log(x), x) # -x + x*log(x)
integrate(1/(x*log(x)), x) # log(log(x))
integrate(log(x)^2, x) # x*log(x)^2 - 2*x*log(x) + 2*x
Trigonometric Functions
Basic trigonometric functions are transformed to exponential form:
integrate(sin(x), x) # Transformed via half-angle formulas
integrate(cos(x), x) # Transformed via half-angle formulas
integrate(tan(x), x) # Uses differential field extension
Hyperbolic Functions
Hyperbolic functions are transformed to exponential form:
integrate(sinh(x), x) # Equivalent to (exp(x) - exp(-x))/2
integrate(cosh(x), x) # Equivalent to (exp(x) + exp(-x))/2
integrate(tanh(x), x) # Transformed to exponential form
Algorithm: The Risch Method
The Risch algorithm builds a tower of differential fields to handle transcendental extensions systematically.
Differential Field Tower
For an integrand like exp(x^2) * log(x)
, the algorithm constructs:
- Base field:
ℚ(x)
with derivationd/dx
- First extension:
ℚ(x, log(x))
withD(log(x)) = 1/x
- Second extension:
ℚ(x, log(x), exp(x^2))
withD(exp(x^2)) = 2*x*exp(x^2)
Integration Steps
- Field Tower Construction: Build the appropriate differential field tower
- Canonical Form: Transform the integrand to canonical form in the tower
- Residue Computation: Apply the Risch algorithm recursively
- Result Assembly: Convert back to symbolic form
Implementation Details
Function Transformations
The algorithm transforms complex functions to simpler forms:
- Trigonometric functions → Half-angle formulas with
tan(x/2)
- Hyperbolic functions → Exponential expressions
- Inverse functions → Differential field extensions
Example: sin(x) Integration
# sin(x) is transformed to:
# 2*tan(x/2) / (1 + tan(x/2)^2)
# Then integrated using the Risch algorithm
Advanced Usage
Direct Algorithm Access
You can access the lower-level algorithms directly:
# Use the Risch algorithm directly
using SymbolicIntegration
# ... (advanced example would go here)
Custom Derivations
# Create custom differential field extensions
# ... (advanced example would go here)
Limitations
- No algebraic functions (√x, x^(1/3), etc.)
- Some complex trigonometric cases may not be handled
- Non-elementary integrals return unevaluated forms