integration problem



On Tue, Jun 27, 2006 at 06:09:21PM -0600, Robert Dodier wrote:
> Daniel,
> 
> I don't see anything wrong with the proposed derivation.
> A minor point -- instead of working with the scaling factor in the formulas,
> sometimes it's better to leave it out, get a result, and then make some
> argument about how the result scales. However, even without s, the
> results are goofed up. Rats.
> 
> >(%i1) cdf:1/(1+exp(-x/s));
> 
> I see a couple of things going on when I try this problem.
> 
> (1) Attempting to integrate the pdf times x^2
> over a finite interval introduces a dilogarithm term, and that seems
> to make getting to the limit more difficult (if Maxima goes by that
> route -- didn't look closely enough to know for sure).

> If it's agreed that this problem tickles some bugs in Maxima,
> it would be extremely helpful if you would submit reports to the bug 
> tracker.

Glad to. I'll need to figure out how to do it again. but no problem.

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.

display2d:false;

(%o1) false
(%i2) cdf:1/(1+exp(-(x-m)/s));

(%o2) 1/(%e^((m-x)/s)+1)
(%i3) pdf:diff(cdf,x);

(%o3) %e^((m-x)/s)/(s*(%e^((m-x)/s)+1)^2)
(%i4) assume(k > 0);

(%o4) [k > 0]
(%i5) assume(s>0);

(%o5) [s > 0]
(%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) subst(exp1,%e^(k/s),%);

(%o7) 2*(-(li[2](-exp1)*(2*exp1*s^3+2*s^3)+log(exp1+1)*(2*exp1*k*s^2+2*k*s^2)
					  -exp1*k^2*s)
	/(exp1+1)
	-%pi^2*s^3/6)
       /s
(%i8) expand(%);

(%o8) -4*exp1*li[2](-exp1)*s^2/(exp1+1)-4*li[2](-exp1)*s^2/(exp1+1)
		>>>>> THIS TERM	       -%pi^2*s^2/3
				       -4*exp1*log(exp1+1)*k*s/(exp1+1)
				       -4*log(exp1+1)*k*s/(exp1+1)
				       +2*exp1*k^2/(exp1+1)


So my guess is that the integrator borked even on this definite
integral. So I'm stuck.


-- 
Daniel Lakeland
dlakelan at street-artists.org
http://www.street-artists.org/~dlakelan