# Symbolics.jl: \`simplify\` is inconsistent when changing the number of terms

**URL:** <https://discourse.julialang.org/t/symbolics-jl-simplify-is-inconsistent-when-changing-the-number-of-terms/133751>\
**Category:** General Usage\
**Tags:** symbolics\
**Created:** [November 8, 2025, 3:19pm UTC](https://discourse.julialang.org/t/symbolics-jl-simplify-is-inconsistent-when-changing-the-number-of-terms/133751 "2025-11-08T15:19:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JaydevSR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jaydevsr/32/31752_2.png) [@JaydevSR](https://discourse.julialang.org/u/JaydevSR)\
**Post date:** [November 8, 2025, 3:19pm UTC](https://discourse.julialang.org/t/symbolics-jl-simplify-is-inconsistent-when-changing-the-number-of-terms/133751/1 "2025-11-08T15:19:00Z")

</div>

I am using `simplify` for the below terms:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/a/3a5ed616ddc76bb8c21a224cc33f94a7a85e4000.png)

for which I get the following result:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/b/2b58a27f60cc6f7ab18cfcb7673663b29587dbdb.png)

As you can see that depending on the number of terms in the expressions, it gives inconsistent results. For some terms it’s able to completely get the common factors whereas for others it cannot. What is the possible reason for this? Is there a way to get the common factors completely?

Edit: I did something like below which works but seems a bit hacky, `simplify` should be able to do this by itself or is it not true?

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/2/b2713fc8bafced2f5488bab97ec75ca4f6a91cf6.png)

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [November 8, 2025, 3:47pm UTC](https://discourse.julialang.org/t/symbolics-jl-simplify-is-inconsistent-when-changing-the-number-of-terms/133751/2 "2025-11-08T15:47:37Z")

</div>

There are currently 92 open issues regarding `simplify`: [GitHub · Where software is built](https://github.com/JuliaSymbolics/Symbolics.jl/issues?q=is%3Aissue%20state%3Aopen%20simplify) (and also a lot of closed issues).

Feel free to add a new issue if your example has not been reported yet.

I think there are two higher level issues:

- how simplify is supposed to work is hard to clearly define, because many choices are subjective
- the current implementation needs some more years to mature

---

<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:** [November 8, 2025, 7:00pm UTC](https://discourse.julialang.org/t/symbolics-jl-simplify-is-inconsistent-when-changing-the-number-of-terms/133751/3 "2025-11-08T19:00:10Z")

</div>

Yeah that’s a property of rule-based methods. We need to keep improving it but also probably need to look into e-graph simplifiers as well. Open an issue so we have more data for the future.

---

<div class="post-metadata">

**Author:** ![JaydevSR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jaydevsr/32/31752_2.png) [@JaydevSR](https://discourse.julialang.org/u/JaydevSR)\
**Post date:** [November 9, 2025, 4:15pm UTC](https://discourse.julialang.org/t/symbolics-jl-simplify-is-inconsistent-when-changing-the-number-of-terms/133751/4 "2025-11-09T16:15:31Z")

</div>

Opened an issue linked here: [`simplify`: Inconsistencies in common factor extraction between different number of terms · Issue #1680 · JuliaSymbolics/Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl/issues/1680)
