From ac379bdee9f8102724765978405b7254617f7d97 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Fri, 16 Jul 2021 07:34:45 +0300 Subject: [PATCH] Add regression test Closes sympy/sympy#21741 --- diofant/tests/integrals/test_integrals.py | 25 +++++++++++++++-------- docs/release/notes-0.13.rst | 1 + 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/diofant/tests/integrals/test_integrals.py b/diofant/tests/integrals/test_integrals.py index beac8daad6c..d59d40fa375 100644 --- a/diofant/tests/integrals/test_integrals.py +++ b/diofant/tests/integrals/test_integrals.py @@ -1,14 +1,14 @@ import pytest from diofant import (Add, And, Ci, Derivative, DiracDelta, E, Eq, EulerGamma, - Expr, Function, I, Integral, Interval, Lambda, LambertW, - Matrix, Max, Min, Mul, Ne, O, Piecewise, Poly, Rational, - Si, Sum, Symbol, Tuple, acos, acosh, arg, asin, asinh, - atan, cbrt, cos, cosh, diff, erf, erfi, exp, expand_func, - expand_mul, factor, floor, fresnels, gamma, im, integrate, - log, lowergamma, meijerg, nan, oo, pi, polar_lift, - polygamma, re, sign, simplify, sin, sinh, sqrt, sstr, - symbols, sympify, tan, tanh, trigsimp) + Expr, Float, Function, I, Integral, Interval, Lambda, + LambertW, Matrix, Max, Min, Mul, Ne, O, Piecewise, Poly, + Rational, Si, Sum, Symbol, Tuple, acos, acosh, arg, asin, + asinh, atan, cbrt, cos, cosh, diff, erf, erfi, exp, + expand_func, expand_mul, factor, floor, fresnels, gamma, + im, integrate, log, lowergamma, meijerg, nan, oo, pi, + polar_lift, polygamma, re, sign, simplify, sin, sinh, + sqrt, sstr, symbols, sympify, tan, tanh, trigsimp) from diofant.abc import A, L, R, a, b, c, h, i, k, m, s, t, w, x, y, z from diofant.functions.elementary.complexes import periodic_argument from diofant.integrals.heurisch import heurisch @@ -1418,3 +1418,12 @@ def test_sympyissue_21721(): b = Symbol('b', real=True) assert e.subs({a: b}).doit() == 1 + + +def test_sympyissue_21741(): + e = exp(-2*I*pi*(z*x + t*y)/(500*10**-9)) + assert (integrate(e, z) == + Piecewise((z, Eq(pi*x, 0)), + (Float('2.5000000000000004e-7', dps=15) * + exp(-Float('3999999.9999999995', dps=15) * + I*pi*(t*y + x*z))*I/(pi*x), True))) diff --git a/docs/release/notes-0.13.rst b/docs/release/notes-0.13.rst index 4d2597278ac..36f1a36b854 100644 --- a/docs/release/notes-0.13.rst +++ b/docs/release/notes-0.13.rst @@ -105,3 +105,4 @@ These Sympy issues also were addressed: * :sympyissue:`21711`: odd result for integrate(sqrt(1 - (x-1)*(x-1)), (x, 0, 1)) * :sympyissue:`21721`: Bug in integration solver * :sympyissue:`21716`: isympy -c python tab triggered auto completion not working +* :sympyissue:`21741`: integrate() does not work with multivariable function that is solved by simple substitution. DomainError: there is no ring associated with CC