[Maxima] nintegrate function
andrej.vodopivec at gmail.com
Thu May 24 13:04:55 CDT 2007
On 5/24/07, Robert Dodier <robert.dodier at gmail.com> wrote:
> I don't see the point of this. If the user wants to be sure a specific
> numerical method is used, they'll have to call quad_qags or
> whatever directly. There's no guarantee (and there should not be
> one) that nintegrate is going to call this or that Quadpack function;
> any number of numerical methods might be employed, and one
> of them can be, "Compute the antiderivative, if you can, and plug
> in the endpoints."
"Compute the antiderivative and plug in the endpoint" may not work:
(%i4) integrate(exp(x^2), x, 0, 1);
I don't know how to get a numerical value from this. But this is not
really the point.
Perhaps I did not make myself clear enough. I didn't want to write a
function nintegrate which would make whatever it can to get the best
I think that it is wrong that we have such low level functions as
quad_qags, quad_qagi, lbfgs, dgeev with no wrapper functions. There is
nothing wrong with them and people who know them should use them, but
for people like me who do not use them every day these things are hard
to remember (I almost never get the arguments to quad_qagi right the
first time I try).The purpose is not to write a function which works
perfectly for every input, but to write something user-friendly which
will work almost all the time - and if it does not you can use the low
level function. It's called nintegrate because I don't care which
algorithm it uses.
I don't care that much if it is a simplifying function or evaluated
function. But I would prefer if it returned unevaluated if it can't
find a numerical result, for example if the bounds are symbolic. I
would also like nintegrate(nintegrate(x+y,x,0,y),y,0,1); to work
without the '() around the inner function - it is much more
user-friendly but not essential.
Anyway, zeta(x) is an evaluated function and psi(x) is a
simplifying function if I remember correctly. What is a user-visible
difference between them?
(the second part is really a response to your other mail)
More information about the Maxima