Skip to content

Commit 8f4a925

Browse files
Merge pull request #4 from ChrisRackauckas-Claude/polish-and-docs
Polish package: fix integration symbol, add .gitignore, fix docs
2 parents 5df1ad6 + 5a2c5e0 commit 8f4a925

File tree

5 files changed

+95
-39
lines changed

5 files changed

+95
-39
lines changed

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Julia
2+
Manifest.toml
3+
docs/Manifest.toml
4+
5+
# Documentation build artifacts
6+
docs/build/
7+
8+
# Julia compiled files
9+
*.ji
10+
*.o
11+
*.so
12+
13+
# Backup files
14+
*~
15+
*.bak
16+
17+
# Editor files
18+
.vscode/
19+
.idea/
20+
*.swp
21+
*.tmp
22+
23+
# OS generated files
24+
.DS_Store
25+
.DS_Store?
26+
._*
27+
.Spotlight-V100
28+
.Trashes
29+
ehthumbs.db
30+
Thumbs.db

docs/Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3-
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
43
SymbolicIntegration = "315ce56f-eed0-411d-ab8a-2fbdf9327b51"
4+
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
55

66
[compat]
7-
Documenter = "1"
7+
Documenter = "1"
8+
Symbolics = "6"

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Documenter, SymbolicIntegration
1+
using Documenter, SymbolicIntegration, Symbolics
22

33
makedocs(
44
sitename="SymbolicIntegration.jl",

docs/src/api.md

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,42 @@ CurrentModule = SymbolicIntegration
1010
integrate
1111
```
1212

13-
## Internal Types and Functions
13+
## Algorithm Overview
1414

15-
```@docs
16-
Term
17-
IdTerm
18-
FunctionTerm
19-
Result
20-
```
15+
SymbolicIntegration.jl implements the complete symbolic integration algorithms from Manuel Bronstein's book "Symbolic Integration I: Transcendental Functions".
2116

22-
## Algorithm Functions
17+
### Supported Function Classes
2318

24-
### Rational Function Integration
19+
- **Polynomial functions**: ∫xⁿ dx
20+
- **Rational functions**: ∫P(x)/Q(x) dx using Rothstein-Trager method
21+
- **Exponential functions**: ∫exp(f(x)) dx using Risch algorithm
22+
- **Logarithmic functions**: ∫log(f(x)) dx using integration by parts
23+
- **Trigonometric functions**: Transformed to exponential form
2524

26-
```@docs
27-
IntegrateRationalFunction
28-
HermiteReduce
29-
IntRationalLogPart
30-
```
25+
### Algorithm Components
3126

32-
### Transcendental Function Integration
27+
The package includes implementations of:
28+
- Hermite reduction for rational functions
29+
- Rothstein-Trager method for logarithmic parts
30+
- Risch algorithm for transcendental functions
31+
- Differential field tower construction
32+
- Complex root finding for arctangent terms
3333

34-
```@docs
35-
Integrate
36-
HermiteReduce
37-
ResidueReduce
38-
PolynomialReduce
39-
```
34+
## Internal Structure
4035

41-
### Differential Field Operations
36+
The package is organized into several algorithm modules:
37+
- `rational_functions.jl`: Rational function integration algorithms
38+
- `transcendental_functions.jl`: Risch algorithm implementation
39+
- `differential_fields.jl`: Differential field operations
40+
- `complex_fields.jl`: Complex number field handling
41+
- `frontend.jl`: User interface and expression conversion
4242

43-
```@docs
44-
BasicDerivation
45-
ExtensionDerivation
46-
AlgebraicExtensionDerivation
47-
```
48-
49-
## Utility Functions
43+
## Error Handling
5044

51-
```@docs
52-
isrational
53-
rationalize
54-
constant_roots
55-
```
45+
The package defines custom exception types:
46+
- `NotImplementedError`: For unsupported function types
47+
- `AlgorithmFailedError`: When no elementary antiderivative exists
48+
- `AlgebraicNumbersInvolved`: When algebraic numbers complicate the result
5649

5750
## Index
5851

src/frontend.jl

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,9 +731,41 @@ function TowerOfDifferentialFields(terms::Vector{Term}) where
731731
end
732732

733733

734-
Symbolics.@syms (f, x)
734+
@variables (.., ..)
735735

736-
# Main integration interface for Symbolics.jl
736+
"""
737+
integrate(f, x; kwargs...)
738+
739+
Compute the symbolic integral of expression `f` with respect to variable `x`.
740+
741+
# Arguments
742+
- `f`: Symbolic expression to integrate (Symbolics.Num)
743+
- `x`: Integration variable (Symbolics.Num)
744+
745+
# Keyword Arguments
746+
- `useQQBar::Bool=false`: Use algebraic closure for root finding
747+
- `catchNotImplementedError::Bool=true`: Catch implementation errors gracefully
748+
- `catchAlgorithmFailedError::Bool=true`: Catch algorithm failures gracefully
749+
750+
# Returns
751+
- Symbolic expression representing the antiderivative (Symbolics.Num)
752+
753+
# Examples
754+
```julia
755+
using SymbolicIntegration, Symbolics
756+
@variables x
757+
758+
# Basic polynomial integration
759+
integrate(x^2, x) # (1//3)*(x^3)
760+
761+
# Rational function integration
762+
integrate(1/(x^2 + 1), x) # atan(x)
763+
764+
# Transcendental functions
765+
integrate(exp(x), x) # exp(x)
766+
integrate(log(x), x) # -x + x*log(x)
767+
```
768+
"""
737769
function integrate(f::Symbolics.Num, x::Symbolics.Num; kwargs...)
738770
# Extract SymbolicUtils expressions from Symbolics.Num wrappers
739771
result_symbolic = integrate(f.val, x.val; kwargs...)

0 commit comments

Comments
 (0)