Skip to content

Commit 6bd7b60

Browse files
authored
Merge branch 'JuliaSymbolics:main' into main
2 parents 88e3630 + b5dc148 commit 6bd7b60

File tree

179 files changed

+290
-84069
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+290
-84069
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ updates:
55
directory: "/" # Location of package manifests
66
schedule:
77
interval: "weekly"
8+
ignore:
9+
- dependency-name: "crate-ci/typos"
10+
update-types: ["version-update:semver-patch", "version-update:semver-minor"]

.github/workflows/Documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
statuses: write
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1919
- uses: julia-actions/setup-julia@v2
2020
with:
2121
version: '1'

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
arch:
3232
- x64
3333
steps:
34-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v5
3535
- uses: julia-actions/setup-julia@v2
3636
with:
3737
version: ${{ matrix.version }}

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout Actions Repository
11-
uses: actions/checkout@v4
11+
uses: actions/checkout@v5
1212
- name: Check spelling
1313
uses: crate-ci/[email protected]

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Manifest.toml
33
docs/Manifest.toml
44

5+
# Mathematica (useful for translation of new rules)
6+
*.m
7+
58
# Documentation build artifacts
69
docs/build/
710

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ license = "MIT"
55
authors = ["HaraldHofstaetter <[email protected]>", "Mattia Micheletta Merlin <[email protected]>", "Chris Rackauckas <[email protected]>", "JuliaSymbolics contributors"]
66
description = "Symbolic integration algorithms for Julia"
77
repository = "https://github.com/JuliaSymbolics/SymbolicIntegration.jl"
8-
version = "2.0.0"
8+
version = "3.2.0"
99

1010
[deps]
1111
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
@@ -20,12 +20,12 @@ SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
2020
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2121

2222
[compat]
23-
AbstractAlgebra = "0.46"
23+
AbstractAlgebra = "0.46, 0.47"
2424
Combinatorics = "1.0.2"
2525
Elliptic = "1.0.1"
2626
FresnelIntegrals = "0.2.0"
2727
HypergeometricFunctions = "0.3.28"
28-
Nemo = "0.51"
28+
Nemo = "0.51, 0.52"
2929
PolyLog = "2.6.0"
3030
SymbolicUtils = "3"
3131
Symbolics = "6"

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
# SymbolicIntegration.jl
22

3-
[![Build Status](https://github.com/JuliaSymbolics/SymbolicIntegration.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaSymbolics/SymbolicIntegration.jl/actions/workflows/CI.yml?query=branch%3Amain)
3+
[![Build Status](https://github.com/JuliaSymbolics/SymbolicIntegration.jl/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/JuliaSymbolics/SymbolicIntegration.jl/actions/workflows/ci.yml?query=branch%3Amain)
44
[![Spell Check](https://github.com/JuliaSymbolics/SymbolicIntegration.jl/actions/workflows/spellcheck.yml/badge.svg?branch=main)](https://github.com/JuliaSymbolics/SymbolicIntegration.jl/actions/workflows/spellcheck.yml)
55
[![Rules](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/JuliaSymbolics/SymbolicIntegration.jl/main/.github/badges/rules-count.json&query=$.message&label=Total%20rules&color=blue)](https://github.com/JuliaSymbolics/SymbolicIntegration.jl)
66

77

88
SymbolicIntegration.jl solves indefinite integrals using one of the implemented algorithms: Risch method and Rule based method
99

10+
# Documentation
11+
12+
For information on using the package,
13+
[see the stable documentation](https://docs.sciml.ai/SymbolicIntegration/stable/). Use the
14+
[in-development documentation](https://docs.sciml.ai/SymbolicIntegration/dev/) for the version of
15+
the documentation which contains the unreleased features.
1016

1117
# Usage
18+
1219
```julia
1320
julia> using Pkg; Pkg.add("SymbolicIntegration") # installation
1421

@@ -76,9 +83,9 @@ trigonometric functions | ? | sometimes
7683
hyperbolic functions | ✅ | sometimes
7784
Nonelementary integrals | ❌ | most of them
7885
Special functions | ❌ | ❌
79-
more than one symbolic<br> variable in the expression | ❌ | ✅
86+
multiple symbols | ❌ | ✅
8087
81-
More info about them in the [methods documentation](methods/overview.md)
88+
More info about them in the [methods documentation](https://docs.sciml.ai/SymbolicIntegration/dev/methods/overview/)
8289
8390
### Risch Method
8491
Complete symbolic integration using the Risch algorithm from Manuel Bronstein's "Symbolic Integration I: Transcendental Functions".
@@ -90,7 +97,7 @@ This method uses a large number of integration rules that specify how to integra
9097
# Documentation
9198
9299
Complete documentation with method selection guidance, algorithm details, and examples is available at:
93-
**[https://symbolicintegration.juliasymbolics.org](https://symbolicintegration.juliasymbolics.org)**
100+
**[docs.sciml.ai/SymbolicIntegration](docs.sciml.ai/SymbolicIntegration/dev/)**
94101
95102
96103
# Citation

docs/make.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ makedocs(
1616
"Home" => "index.md",
1717
"Manual" => [
1818
"manual/getting_started.md",
19-
"manual/basic_usage.md",
19+
"manual/contributing.md",
2020
],
2121
"Integration Methods" => [
2222
"methods/overview.md",
2323
"methods/risch.md",
24-
],
25-
"Algorithm Details" => [
26-
"manual/rational_functions.md",
27-
"manual/transcendental_functions.md",
24+
"methods/rulebased.md",
25+
"methods/risch_rational_functions.md",
26+
"methods/risch_transcendental_functions.md",
2827
],
2928
"API Reference" => "api.md",
3029
],

docs/src/index.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ integrate(f, x, RischMethod(use_algebraic_closure=true)) # With options
3939

4040
## Integration Methods
4141

42-
SymbolicIntegration.jl provides two integration algorithms: Rule based and Risch method. Here is a quick table to see what they can integrate:
42+
SymbolicIntegration.jl provides two integration algorithms: Risch method and Rule based method.
43+
44+
**Default Behavior:** When no method is explicitly specified, `integrate()` will first attempt the **Risch method**. If the Risch method fails (e.g., due to unsupported expressions like `sqrt(x)` or `abs(x)`), it will automatically fall back to the **Rule based method**. This ensures maximum coverage while prioritizing the theoretically complete Risch algorithm when applicable.
45+
46+
Here is a quick table to see what each method can integrate:
4347

4448
feature | Risch | Rule based
4549
--------|-------|-----------
@@ -51,10 +55,33 @@ trigonometric functions | ? | sometimes
5155
hyperbolic functions | ✅ | sometimes
5256
Nonelementary integrals | ❌ | most of them
5357
Special functions | ❌ | ❌
54-
more than one symbolic<br> variable in the expression | ❌ | ✅
58+
multiple symbols | ❌ | ✅
5559

5660
[→ See complete methods documentation](methods/overview.md)
5761

62+
### Example: Automatic Fallback Behavior
63+
64+
When no method is specified, the integration will try Risch first, then fall back to Rule based if needed:
65+
66+
```julia
67+
# This uses sqrt which is not supported by Risch, so it falls back to RuleBasedMethod
68+
integrate(sqrt(x))
69+
# ┌ Warning: NotImplementedError: integrand contains unsupported expression sqrt(x)
70+
# └ @ SymbolicIntegration
71+
#
72+
# > RischMethod failed returning ∫(sqrt(x), x)
73+
# > Trying with RuleBasedMethod...
74+
#
75+
# (2//3)*(x^(3//2))
76+
```
77+
78+
You can also explicitly specify which method to use:
79+
80+
```julia
81+
integrate(sqrt(x), x, RuleBasedMethod()) # Skip Risch, use Rule based directly
82+
integrate(x^2 + 1, x, RischMethod()) # Use only Risch
83+
```
84+
5885
### RischMethod
5986
This method is based on the algorithms from the book:
6087

@@ -68,7 +95,7 @@ integrate(x^2 + 1, x, RischMethod(use_algebraic_closure=false, catch_errors=true
6895
- `use_algebraic_closure` does what?
6996
- `catch_errors` does what?
7097

71-
[→ See detailed Risch documentation](risch.md)
98+
[→ See detailed Risch documentation](methods/risch.md)
7299

73100
### RuleBased
74101
This method uses a large number of integration rules that specify how to integrate various mathematical expressions.
@@ -102,10 +129,7 @@ If you use SymbolicIntegration.jl in your research, please cite:
102129

103130
```@contents
104131
Pages = [
105-
"manual/getting_started.md",
106-
"manual/basic_usage.md",
107-
"manual/rational_functions.md",
108-
"manual/transcendental_functions.md",
132+
"manual/contributing.md",
109133
"api.md"
110134
]
111135
Depth = 2

docs/src/manual/contributing.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
- [Contributing to improving RuleBasedMethod](#contributing-to-improving-rulebasedmethod)
1+
# Contributing
2+
3+
We welcome contributions!
4+
5+
Below there are detailed info on how to contribute to the translation of new rules from the Mathematica [RUBI](https://rulebasedintegration.org/) package, or translation of solved integrals to use as tests, from the same package.
6+
7+
- [Contributing to RuleBasedMethod](#contributing-to-rulebasedmethod)
28
- [Common problems when translating rules](#common-problems-when-translating-rules)
39
- [function not translated](#function-not-translated)
410
- [Sum function translation](#sum-function-translation)
@@ -13,10 +19,10 @@
1319
- [end](#end)
1420
- [Adding Testsuites](#adding-testsuites)
1521

16-
# Contributing to improving RuleBasedMethod
22+
# Contributing to translating new rules for RuleBasedMethod
1723

18-
In this repo there is also some software that serves the sole purpose of helping with the translation of rules from Mathematica syntax, and not for the actual package working. The important ones are:
19-
- translator_of_rules.jl is a script that with regex and other string manipulations translates from Mathematica syntax to julia syntax
24+
In the github repo of the package there is also some software that serves the sole purpose of helping with the translation of rules from Mathematica syntax, and not for the actual package working. The important ones are:
25+
- translator_of_rules.jl is a script that with regex and other string manipulations translates from Mathematica syntax to julia syntax (see "houw to use it" section later)
2026
- translator_of_testset.jl is a script that translates the testsets into julia syntax (much simpler than translator_of_rules.jl)
2127
- `reload_rules` function in rules_loader.jl. When developing the package using Revise is not enough because rules are defined with a macro. So this function reloads rules from a specific .jl file or from all files if called without arguments.
2228

@@ -75,10 +81,11 @@ This script is used to translate integration rules from Mathematica syntax
7581
to julia Syntax.
7682

7783
### How to use it
84+
In the branch `rules` of the github repo of the package there are all the Mathematica files containing the untranslated rules already in the correct folders in this repo, so that you can use the translator script like this:
7885
``` bash
7986
julia src/translator_of_rules.jl "src/rules/4 Trig functions/4.1 Sine/4.1.8 trig^m (a+b cos^p+c sin^q)^n.m"
8087
```
81-
and will produce the julia file at the path `src/rules/4 Trig functions/4.1 Sine/4.1.8 trig^m (a+b cos^p+c sin^q)^n.jl`
88+
this will produce the julia file at the path `src/rules/4 Trig functions/4.1 Sine/4.1.8 trig^m (a+b cos^p+c sin^q)^n.jl`
8289

8390
### How it works internally (useful to know if you have to debug it)
8491
It processes line per line, so the integration rule must be all on only one
@@ -170,4 +177,4 @@ finally the rule is placed in a tuple (index, rule), and all the
170177
tuples are put into a array, ready to be included by load_rules
171178

172179
## Adding Testsuites
173-
There is a test suite of 27585 solved integrals taken from the RUBI package, in the folders `test/test_files/0 Independent test suites` (1796 tests) and `test/test_files/1 Algebraic functions` (25798 tests). But more test can be translated from the [RUBI testsuite](https://rulebasedintegration.org/testProblems.html). In [this](https://github.com/Bumblebee00/SymbolicIntegration.jl?tab=readme-ov-file#testing) repo there are the tests still in Mathematica syntax and a script to translate them to julia.
180+
There is a test suite of 27585 solved integrals taken from the RUBI package, in the folders `test/test_files/0 Independent test suites` (1796 tests) and `test/test_files/1 Algebraic functions` (25798 tests). But more test can be translated from the [RUBI testsuite](https://rulebasedintegration.org/testProblems.html). In the branch `rules` of this repo there are the tests still in Mathematica syntax and a script to translate them to julia.

0 commit comments

Comments
 (0)