Edwin Woollett wrote:
>
> (%i1) display2d:false$
> (%i2) quad_qagi(exp(-x^2),x,0,inf);
> (%o2) [0.88622692545276,7.101318390915455E-9,135,0]
> (%i3) quad_qagi(exp(-x^2),x,minf,0);
> (%o3) quad_qagi(%e^-x^2,x,minf,0,epsrel = 1.0E-8,epsabs = 0.0,limit = 200)
> (%i4) quad_qagi(exp(-x^2),x,minf,inf);
> (%o4) quad_qagi(%e^-x^2,x,minf,inf,epsrel = 1.0E-8,epsabs = 0.0,limit = 200)
> (%i5) quad_qagi(exp(-x^2),x,minf,both);
> (%o5) quad_qagi(%e^-x^2,x,minf,both,epsrel = 1.0E-8,epsabs = 0.0,limit =
> 200)
How about this:
(%i1) quad_qagi(exp(-x^2),x,minf,0);
(%o1) [.8862269254527579, 7.101318390472462E-9, 135, 0]
(%i2) quad_qagi(exp(-x^2),x,minf,0, epsrel=1d-8, epsabs=0,limit=200);
(%o2) [.8862269254527579, 7.101318390472462E-9, 135, 0]
(%i3) quad_qagi(exp(-x^2),x,minf,inf);
(%o3) [1.772453850905516, 1.4202636780944924E-8, 270, 0]
(%i7) quad_qagi(exp(-x^2),x,0,2);
One of limits for QAGI must be infinity: 0 2
-- an error. To debug this try debugmode(true);
I think this is a more natural interface. We produce an error for the
last example because quad_qagi expects an unbounded integral. While we
could call some other integrator in this case, I think the fact that the
user wanted qagi instead of something else should preclude us from
pretending to be smart and potentially getting the answer wrong. If the
integral is not bounded, the user should pick something else.
Ray