Skip to content

Commit

Permalink
Merge pull request #17971 from oscarbenjamin/solve_zoo
Browse files Browse the repository at this point in the history
Fix solve for exponential equations w infinities
  • Loading branch information
oscarbenjamin committed Nov 27, 2019
2 parents b24bdaf + ce0b1b6 commit df4ad94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sympy/solvers/solvers.py
Expand Up @@ -2830,6 +2830,8 @@ def equal(expr1, expr2):
if flags.pop('force', True):
flags['force'] = False
pos, reps = posify(lhs - rhs)
if rhs == S.ComplexInfinity:
return []
for u, s in reps.items():
if s == sym:
break
Expand Down
7 changes: 7 additions & 0 deletions sympy/solvers/tests/test_solvers.py
Expand Up @@ -2121,3 +2121,10 @@ def test_issue_17799():
def test_issue_17650():
x = Symbol('x', real=True)
assert solve(abs((abs(x**2 - 1) - x)) - x) == [1, -1 + sqrt(2), 1 + sqrt(2)]


def test_issue_17949():
assert solve(exp(+x+x**2), x) == []
assert solve(exp(-x+x**2), x) == []
assert solve(exp(+x-x**2), x) == []
assert solve(exp(-x-x**2), x) == []

0 comments on commit df4ad94

Please sign in to comment.