Skip to content

Commit

Permalink
integrals: correct Integral._eval_nseries()
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Apr 23, 2022
1 parent 7f90777 commit f619b4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions diofant/integrals/integrals.py
Expand Up @@ -928,6 +928,7 @@ def _eval_nseries(self, x, n, logx):
break
terms, order = expr.function.nseries(
x=symb, n=n, logx=logx).as_coeff_add(Order)
order = [o.subs({symb: x}) for o in order]
return integrate(terms, *expr.limits) + Add(*order)*x

def as_sum(self, n, method='midpoint'):
Expand Down
2 changes: 1 addition & 1 deletion diofant/tests/integrals/test_integrals.py
Expand Up @@ -862,7 +862,7 @@ def test_is_real():
def test_series():
i = Integral(cos(x), (x, x))
e = i.series(x, n=None)
s1 = i.nseries(x, n=8).removeO().doit()
s1 = i.series(x, n=8).removeO().doit()
s2 = Add(*[next(e) for j in range(4)])
assert s1 == s2

Expand Down

0 comments on commit f619b4e

Please sign in to comment.