The issue is likely due to some Maxima update. You can run sage -maxima
to work directly with maxima. Using Maxima 5.29.1 from Sage 6.1 I get
Maxima 5.29.1 http://maxima.sourceforge.net
(%i1) fu:1/8*(%i*sqrt(2)*(erf(1/2*sqrt(2)*(%i*%pi + 2*u + 1)) - erf(1/2*sqrt(2)*(-%i*%pi + 2*u + 1)))*%e^(u + 1/2) + sqrt(2)*(-%i*erf(1/2*sqrt(2)*(%i*%pi - 2*u + 1)) + %i*erf(1/2*sqrt(2)*(-%i*%pi - 2*u + 1)))*%e^(u + 1/2) - (sqrt(2)*%e^(1/8) - sqrt(2)*%e^(2*u + 1/8))*(erf(1/4*sqrt(2)*(2*%i*%pi + 4*u + 1)) + erf(1/4*sqrt(2)*(-2*%i*%pi + 4*u + 1))) - (sqrt(2)*%e^(1/8) - sqrt(2)*%e^(2*u + 1/8))*(erf(1/4*sqrt(2)*(2*%i*%pi - 4*u + 1)) + erf(1/4*sqrt(2)*(-2*%i*%pi - 4*u + 1))))*%e^(-u)/sqrt(%pi) $
(%i2) quad_qags(fu,u,0,2,limit=200,epsrel=1e-8) ;
(%o2) [1.4275778409741315, 3.6564080027747881e-14, 63, 0]
Doing the same on Maxima 5.35.1 from the current Sage 6.5.beta5 I get
(%i2) quad_qags(fu,u,0,2,limit=200,epsrel=1e-8) ;
quad_qags: Cannot numerically evaluate errexp1 at 1.0
-- an error. To debug this try: debugmode(true);
The expression errexp1
is equal to fu
. I know little Maxima myself, but I can tell that ev(subst(1,u,fu),numer);
will return an expression with unevaluated erf
calls in both versions of Maxima. In any case, there seems to be some change in Maxima between 5.33.0.p0 from Sage 6.3 and the 5.34.1.p0 used in Sage 6.4. Bisecting the Maxima revision history for this, I traced this problem down to Maxima commit 07a0200. That removes some special handling for erf
, claiming that it should no longer be required. This assumption appears to be incorrect, judging from your experience.
I took the liberty of reporting this as Maxima bug 2881. If there is urgent need for this, and Maxima fails to react in a timely manner, you could probably also open a Sage ticket asking for this commit to be patched out of the Maxima version used by Sage. But in the long run, the best solution is when Maxima developers deal with this.