Maxima 5.9.0
C1) assume(B>0,B-A>0)$
(C2) integrate(log(1+exp(A+B*cos(phi))),phi,0,%pi);
- B B A
(D2) 3 %PI LOG(%E (%E + %E ))
But if we give A and B numerical values
(C3) B:3$ A:2$ ev(D2,numer);
(C4)
(C5)
(D5) 2.952421848475173
(C6) B:3.2$ A:-3$ ev(D2,numer);
(C7)
(C8)
(D8) .0191075509605848
while by evaluating the integral numerically we obtain
something different
(C11) B:3$ A:2$
romberg(log(1+exp(A+B*cos(phi))),phi,0,%pi);
(C12)
(C13)
(D13) 7.506856487627962
(C14) B:3.2$ A:-3$
romberg(log(1+exp(A+B*cos(phi))),phi,0,%pi);
(C15)
(C16)
(D16) 0.663669430006855
The integrand does not look like the kind of thing that
would give the romberg procedure any trouble
(C25) plot2d(log(1+exp(A+B*cos(phi))),[phi,0,%pi])$
In fact, by visual inspection of the plot it is clear
that the area under the curve is much closer to 0.66
(romberg's result) than to 0.02 (as integrate would
have us believe).
The same problem occurs if we use defint instead of
integrate.
Cheers.
Logged In: YES
user_id=501686
Observed in 5.9.3cvs. Not sure, but it looks like integrate
yields a different result when A and B are symbols compared
to when they are given specific values A=2, B=3.
fixed in risch.lisp rev 1.16 - now returns unevaluated.