Skip to content

Commit 4ddfc66

Browse files
Document default integration method behavior in docs
Add clear explanation that integrate() tries Risch first, then falls back to RuleBasedMethod. This matches the README but was missing from the main documentation page. Changes: - Added "Default Behavior" paragraph explaining Risch-first strategy - Added example showing automatic fallback from Risch to Rule based - Added examples of explicit method selection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent d91004b commit 4ddfc66

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

docs/src/index.md

Lines changed: 28 additions & 1 deletion
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
--------|-------|-----------
@@ -55,6 +59,29 @@ 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

0 commit comments

Comments
 (0)