> I fiddled with the expression returned from integrating from 0 to k to
> get it into a form where I could take a limit as k -> inf but it
> doesn't seem to be right. For one thing, the only term that seems like
> it could result in the appropriate answer has the wrong sign.
...
> So my guess is that the integrator borked even on this definite
> integral. So I'm stuck.
When I stick the integral result that maxima gives into the
differentiator I come up with the original expression, so if the
integrator is borked, then so is the differentiator.
In addition, Mathematica seems to give the same result for the
integral from 0 to x that maxima does.
So I'm inclined to believe that the integrator is doing the right
thing, and that the limit finder simply can't figure out how to take
the limit. This isn't too surprising to me since I can't figure out
how to take the limit myself. I have done a few bits of fiddling to
see if I can simplify the limit to something that makes sense... as
follows:
(%i6) var:2*integrate(subst(0,m,pdf*(x-m)^2),x,0,k);
(%o6) 2*(-((2*k*s^2*%e^(k/s)+2*k*s^2)*log(%e^(k/s)+1)
+(2*s^3*%e^(k/s)+2*s^3)*li[2](-%e^(k/s))-k^2*s*%e^(k/s))
/(%e^(k/s)+1)
-%pi^2*s^3/6)
/s
(%i7) expandwrt(%,s);
Warning - you are redefining the Maxima function intersection
(%o7) -4*k*s*%e^(k/s)*log(%e^(k/s)+1)/(%e^(k/s)+1)
-4*k*s*log(%e^(k/s)+1)/(%e^(k/s)+1)
-4*s^2*%e^(k/s)*li[2](-%e^(k/s))/(%e^(k/s)+1)
-4*s^2*li[2](-%e^(k/s))/(%e^(k/s)+1)+2*k^2*%e^(k/s)/(%e^(k/s)+1)
-%pi^2*s^2/3
(%i8) subst(%e^(k/s),%e^(k/s)+1,%);
/* The above step assumes in the limit that those two are essentially
equal*/
(%o8) -4*s^2*%e^-(k/s)*li[2](-%e^(k/s))-4*s^2*li[2](-%e^(k/s))-4*k^2*%e^-(k/s)
-%pi^2*s^2/3-2*k^2
(%i9) subst(0,%e^(-k/s),%);
/* assume in the limit that e^(-k/s) dominates and therefore those terms = 0*/
(%o9) -4*s^2*li[2](-%e^(k/s))-%pi^2*s^2/3-2*k^2
Now does this have a limit as k -> inf?
(%i10) limit(%,k,inf);
(%o10) 'limit(-4*s^2*li[2](-%e^(k/s))-%pi^2*s^2/3-2*k^2,k,inf)
Maxima doesn't know. I tried substituting s = 1, and plotting it and
it rapidly goes to a limit of approximately the right value (%pi^2/3 ~
3.2899).
So I think the integrator is basically doing the right thing, and the
limit finder is simply unable to take the limit.
One thing I noticed about limit finding is that maxima isn't
particularly helpful if it can't find the limit. For example, if the
expression is a sum of terms, and some of them are easy to find such
as exp(-x) as x->inf then it doesn't seem to eliminate those
terms. Also it won't cancel terms that clearly limit to some other
value... such as the exp(k/s)/(exp(k/s)+1) terms which I manually
manipulated above.
for example:
limit(k - k*s*exp(k/s)/(exp(k/s)+1),k,inf)
shouldn't we have some sort of way of manipulating this automatically
to limit(k-k*s,k,inf) ??
In other words, if maxima can't figure out the exact limit, it could
at least help us with asymptotic analysis by figuring out that certain
terms don't affect the limit or affect the limit by a constant amount.
In any case, this exercise has given me a new appreciation for maxima,
and a new appreciation for the fact that maxima provides the tools
necessary to bring human mathematical knowledge to bear even if its
automatic systems are unable to work. That doesn't seem to be true in
other CAS systems I've (naively) used.
Thanks to everyone who is keeping maxima alive!
--
Daniel Lakeland
dlakelan at street-artists.org
http://www.street-artists.org/~dlakelan