I was using mpmath's nsum()
function for summation operation from 1 to inf.
like this
but lambda is one line function and my equations are so long
like
∑_(n=1)^∞▒e^(〖-n〗^2 )/(n^2+ 4〖(a-b)〗
for simple one line summation equations it works but for long summations how to use it?
Is there any way by which we can give long summation equations to the nsum()
function?
import mpmath
mpmath.mp.dps = 50
nsum(lambda x: exp(-x**2), [-inf, inf])