# Best symbolic calculus/algebra package(s) for Julia?

**URL:** https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451
**Category:** General Usage
**Tags:** question
**Created:** [August 6, 2020, 8:18pm UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451 "2020-08-06T20:18:59Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![narnold0](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/narnold0/32/206975_2.png) [@narnold0](https://discourse.julialang.org/u/narnold0)
#### Post date: [August 6, 2020, 8:18pm UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/1 "2020-08-06T20:18:59Z")

</div>

So I’ve been trying out python lately but I learned about Julia and it seems pretty amazing so I want to switch to it.

I set up juno and it’s working fine but I’ve been having trouble finding resources concerning the various symbolic math packages and the benefits and features of them. So far reduce.jl seems interesting and very capable but I’m struggling to find tutorials or help about how to use it. The website isn’t much help. I’m trying to solve for antiderivatives and do lin alg.

Other’s Ive looked at:

symata - apparently you can’t auto solve functions with it? sorta confused about it and little online about it

pyengine

sympy - how powerful is this?

---

<div class="post-metadata">

### Author: ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)
#### Post date: [August 6, 2020, 8:49pm UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/2 "2020-08-06T20:49:18Z")

</div>

Use sympy.jl. It is by far the most complete and documented symbolic math library, although it is a wrapper of SymPy python library, so not the fastest one. But in symbolic math it is rare you are computationally bounded.

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [August 6, 2020, 9:31pm UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/4 "2020-08-06T21:31:50Z")

</div>

ModelingToolkit does a lot, but sadly not antiderivatives yet. We are going to train a neural network solution to that soon though.

---

<div class="post-metadata">

### Author: ![anon37204545](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon37204545](https://discourse.julialang.org/u/anon37204545)
#### Post date: [August 6, 2020, 11:02pm UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/5 "2020-08-06T23:02:57Z")

</div>

> [@ChrisRackauckas](#):
>
> We are going to train a neural network solution to that soon though.

Is it something similar to this?  
[https://www.quantamagazine.org/symbolic-mathematics-finally-yields-to-neural-networks-20200520/](https://www.quantamagazine.org/symbolic-mathematics-finally-yields-to-neural-networks-20200520/)

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [August 6, 2020, 11:03pm UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/6 "2020-08-06T23:03:43Z")

</div>

Yes.

---

<div class="post-metadata">

### Author: ![narnold0](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/narnold0/32/206975_2.png) [@narnold0](https://discourse.julialang.org/u/narnold0)
#### Post date: [August 7, 2020, 12:59am UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/8 "2020-08-07T00:59:56Z")

</div>

Wow interesting, will keep an eye out for that

---

<div class="post-metadata">

### Author: ![narnold0](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/narnold0/32/206975_2.png) [@narnold0](https://discourse.julialang.org/u/narnold0)
#### Post date: [August 7, 2020, 2:11am UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/9 "2020-08-07T02:11:43Z")

</div>

Thanks! What other packages do you use that work well with reduce?

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [August 7, 2020, 2:49am UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/10 "2020-08-07T02:49:48Z")

</div>

Would such a system use automatic or symbolic differentiation to check the results?

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [August 7, 2020, 2:57am UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/11 "2020-08-07T02:57:09Z")

</div>

That’s essentially how you train it. You fuzz a training set of symbolic equations that you symbolically differentiate, and then train a neural network to anti-differentiate the equations by learning the reverse mapping on this dataset. We have an MLH student developing this method over the summer, so hopefully we can get something going soon enough.

---

<div class="post-metadata">

### Author: ![mefob](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mefob](https://discourse.julialang.org/u/mefob)
#### Post date: [August 7, 2020, 4:37am UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/12 "2020-08-07T04:37:18Z")

</div>

@ChrisRackauckas Have you looked at rule-based integration? The rubi rules could be a good starting point. [https://rulebasedintegration.org/](https://rulebasedintegration.org/)

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [August 7, 2020, 11:57am UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/14 "2020-08-07T11:57:21Z")

</div>

> [@mefob](#):
>
> @ChrisRackauckas Have you looked at rule-based integration? The rubi rules could be a good starting point. [https://rulebasedintegration.org/](https://rulebasedintegration.org/)

Rules are hard. But yes, we do plan to get those into SymbolicUtils.jl. @HarrisonGrodin actually had that idea quite awhile ago. It’s just easier to get students hired to train a neural network.

---

<div class="post-metadata">

### Author: ![mefob](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mefob](https://discourse.julialang.org/u/mefob)
#### Post date: [August 7, 2020, 5:33pm UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/15 "2020-08-07T17:33:50Z")

</div>

@ChrisRackauckas I was thinking that the rubi rules could be a good training set as their underlying distribution has been hand picked to be around the most general solutions for each class of integration problems. Rubi also gives intermediate steps that can be used to generate increasingly difficult problems.  
Not sure you can say, but do you plan to do the seq2seq approach from the Facebook paper?

---

<div class="post-metadata">

### Author: ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)
#### Post date: [August 7, 2020, 6:25pm UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/16 "2020-08-07T18:25:05Z")

</div>

> [@ChrisRackauckas](#):
>
> It’s just easier to get students hired to train a neural network.

Also if you can use a distributed blockchain in the cloud!  
🙄

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [August 7, 2020, 6:56pm UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451/17 "2020-08-07T18:56:03Z")

</div>

> [@mefob](#):
>
> I was thinking that the rubi rules could be a good training set as their underlying distribution has been hand picked to be around the most general solutions for each class of integration problems. Rubi also gives intermediate steps that can be used to generate increasingly difficult problems

Yeah so it’s a good to have. We’ll see where it ends up. It’s fun though
