[ANN] SymbolicIntegration.jl - indefinite integration with Symbolics.jl symbols

For a while now I have been developing SymbolicIntegration.jl, that lets you solve symbolic integrals in julia! it has for now two different methods to arrive at the antiderivative:

  • Risch algorithm
  • Rule based method using >3000 rules

Example usage:

julia> integrate(sqrt(4 - 12*x + 9*x^2)+sqrt(1+x),x;verbose=true)
┌-------Applied rule 0_1_0 on ∫(sqrt(1 + x) + sqrt(4 - 12x + 9(x^2)), x)
| ∫( a + b + ..., x) => ∫(a,x) + ∫(b,x) + ...
└-------with result: ∫(sqrt(4 - 12x + 9(x^2)), x) + ∫(sqrt(1 + x), x)
┌-------Applied rule 1_2_1_1_3 on ∫(sqrt(4 - 12x + 9(x^2)), x)
| ∫((a + b * x + c * x ^ 2) ^ p, x) => if 
|       !(contains_var(a, b, c, p, x)) &&
|       (
|             b ^ 2 - 4 * a * c == 0 &&
|             p !== -1 / 2
|       )
| ((b + 2 * c * x) * (a + b * x + c * x ^ 2) ^ p) / (2 * c * (2 * p + 1))
└-------with result: (1//36)*((4 - 12x + 9(x^2))^(1//2))*(-12 + 18x)
┌-------Applied rule 1_1_1_1_4 on ∫(sqrt(1 + x), x)
| ∫((a + b * x) ^ m, x) => if 
|       !(contains_var(a, b, m, x)) &&
|       m !== -1
| (a + b * x) ^ (m + 1) / (b * (m + 1))
└-------with result: ((1 + x)^(3//2)) / (3//2)
((1 + x)^(3//2)) / (3//2) + (1//36)*((4 - 12x + 9(x^2))^(1//2))*(-12 + 18x)

please try it and tell me what you think, also report any bugs or functions that the package is not able to integrate opening issues on github, thanks!!!

12 Likes

Amazing work!

1 Like

Very cool, congrats.

Just for my personal interest, do you have to write these rules by hand?

Because it looks like a nightmare

1 Like

good job!

1 Like

Somebody did: it comes from https://rulebasedintegration.org/

Sadly, the maintainer of that did pass away relatively recently, so the Julia package will likely be the spiritual successor.

3 Likes

exactly, i used the rules from the mathematica package, that contains 6700 integration rules. to convert them to julia I created a script to translate them automatically, but there was stil a lot of translation by hand, just reading mathematica code and writing julia equivalent. Right now approx 3400 rules are translated.

4 Likes