You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/index.md
+31-7Lines changed: 31 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,11 @@ integrate(f, x, RischMethod(use_algebraic_closure=true)) # With options
39
39
40
40
## Integration Methods
41
41
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:
43
47
44
48
feature | Risch | Rule based
45
49
--------|-------|-----------
@@ -51,10 +55,33 @@ trigonometric functions | ? | sometimes
51
55
hyperbolic functions | ✅ | sometimes
52
56
Nonelementary integrals | ❌ | most of them
53
57
Special functions | ❌ | ❌
54
-
more than one symbolic<br> variable in the expression | ❌ | ✅
58
+
multiple symbols | ❌ | ✅
55
59
56
60
[→ See complete methods documentation](methods/overview.md)
57
61
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
Copy file name to clipboardExpand all lines: docs/src/manual/contributing.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff 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)
2
8
-[Common problems when translating rules](#common-problems-when-translating-rules)
3
9
-[function not translated](#function-not-translated)
4
10
-[Sum function translation](#sum-function-translation)
@@ -13,10 +19,10 @@
13
19
-[end](#end)
14
20
-[Adding Testsuites](#adding-testsuites)
15
21
16
-
# Contributing to improving RuleBasedMethod
22
+
# Contributing to translating new rules for RuleBasedMethod
17
23
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)
20
26
- translator_of_testset.jl is a script that translates the testsets into julia syntax (much simpler than translator_of_rules.jl)
21
27
-`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.
22
28
@@ -75,10 +81,11 @@ This script is used to translate integration rules from Mathematica syntax
75
81
to julia Syntax.
76
82
77
83
### 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:
78
85
```bash
79
86
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"
80
87
```
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`
82
89
83
90
### How it works internally (useful to know if you have to debug it)
84
91
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
170
177
tuples are put into a array, ready to be included by load_rules
171
178
172
179
## 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