How can you perform this improper integral as Mathematica does?
问题 Take this Mathematica code: f[x_] := Exp[-x]; c = 0.9; g[x_] := c*x^(c - 1)*Exp[-x^c]; SetPrecision[Integrate[f[x]*Log[f[x]/g[x]], {x, 0.001, \[Infinity]}],20] Mathematica computes this without problem and gives the answer 0.010089328699390866240 . I would like to be able to perform similar integrals but I don't have a copy of Mathematica. Just naively implementing it in scipy, for example, using a standard quadrature library fails sadly because f(x) and g(x) get arbitrarily close to 0. Here