I can't integrate this in python (1/1+t))+(-1/exp(t)) [0,np.inf]
import numpy as np
from math import exp
from scipy.integrate import quad
print(quad(lamba t: (1/1+t))+(-1/exp(t)),0,np.inf)
It must show Euler constant
I can't integrate this in python (1/1+t))+(-1/exp(t)) [0,np.inf]
import numpy as np
from math import exp
from scipy.integrate import quad
print(quad(lamba t: (1/1+t))+(-1/exp(t)),0,np.inf)
It must show Euler constant
By the way, with this integral you will never have the Euler constant.
Euler constant is defined as (sorry I can't post images):
https://i.stack.imgur.com/z6iiM.jpg
So you have to change your
lambda
function to the following:The result is
0.5772156649015537
which is the value of the Euler constant.