Motivated by a recent posting of M. L. Glasser, I found the following example of an elementary function for which the default numerical integration algorithm in Maple V Release 4 comes horribly unstuck.
f := x -> 1/(1+log(1/x)); 1 f := x -> ------------ 1 + log(1/x)
Observe that \(f(x)\) approaches the limit 0 when \(x\) tends to 0 from the right, \(f(1)=1\), and \(f\) is increasing on the interval \([0,1]\). Consequently, the integral of \(f\) on \([0,1]\) is between 0 and 1. However, Maple evaluates the integral to a value of approximately 0.6 times ten to the sixteenth power!
evalf(Int(f(x), x=0..1)); 16 .6066382611 10
Setting infolevel[`evalf/int`]:=1;
reveals where Maple goes wrong in this example.
Near \(x=0\), where Maple thinks that there is a singularity, Maple expands the integrand in a
geometric series in powers of log(x)
and truncates the series, failing to notice that the series
is badly divergent.
Diverting Maple into a diļ¬erent branch of its numerical algorithm produces the correct value of about \(0.596\). For example, each of the following commands gives a correct result.
evalf(Int(1.0*f(x), x=0..1)); evalf(Int(f(x), x=0..1, 10, _Dexp)); evalf(int(1/(1-log(x)), x=0..1));
It is corrected with Maple 6. (U. Klein)