Skip to content

Instantly share code, notes, and snippets.

View 0sidharth's full-sized avatar

Sidharth Mundhra 0sidharth

  • Mumbai, India
View GitHub Profile
@0sidharth
0sidharth / changes.diff
Created October 13, 2021 17:06
Add better multivariate support to `as_leading_term`
diff --git a/sympy/core/expr.py b/sympy/core/expr.py
index 482e382eb6..a4125b46ac 100644
--- a/sympy/core/expr.py
+++ b/sympy/core/expr.py
@@ -3438,7 +3438,16 @@ def as_leading_term(self, *symbols, logx=None, cdir=0):
"""
from sympy import powsimp
if len(symbols) > 1:
- c = self
+ c = self.expand()