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).
(2) Maxima can do some integrals related to tanh and sech^2, but
some others seem flatly wrong.
integrate(sech(x)^2*x^2,x,minf,inf); => %pi^2/6 (might be right, I
didn't check)
integrate(sech(x/2)^2*x^2,x,minf,inf); => 0 (must be wrong)
integrate(sech(x/3)^2*x^2,x,minf,inf); => 0 (must be wrong)
integrate(sech(2*x)^2*x^2,x,minf,inf); => - 47/48 %pi^2 (must be wrong)
This last one is interesting -- Maxima 5.9.3 => - 47/48 %pi^2 while
5.9.1 and 5.9.2 both yield - 11/192 %pi^2, which also must be wrong.
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.
Sorry I can't be more helpful,
Robert Dodier