integration problem



Hi.

I'm trying to derive the variance (or stddev) of the logistic
distribution, as follows.

(%i1) cdf:1/(1+exp(-x/s));

				       1
(%o1) 				  -----------
				    - x/s
				  %e	  + 1
(%i2) pdf:diff(cdf,x);

				     - x/s
				   %e
(%o2) 			       ----------------
				    - x/s     2
			       s (%e	  + 1)
(%i3) var:integrate(pdf*x^2,x,-inf,inf);

Is  s  positive or negative?

pos;
    1
Is  -  an integer?
    s

no;
    2
Is  -  an integer?
    s

no;
Integral is divergent
 -- an error.  Quitting.  To debug this try debugmode(true);
(%i4) 

Now wikipedia claims %pi^2 * s^2 / 3 is the correct variance. Which
means that this integral should not be divergent unless I'm missing
something. What is going on?

When I say yes to the 1/s or 2/s queries, I get a result, but it's not
the one that wikipedia claims.

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