On 4/16/20 7:24 AM, Mihai wrote:
> Hi, I'm very new to Sage, thus it's likely I'm using it wrongly, but is
> this a bug?
>
> Using:
> https://sagecell.sagemath.org/
>
> I entered:
>
> F(x)=1/(1 + exp(-x))
> FN(x,n) = F(x)**n
> assume(n, 'integer')
> assume(log(exp(n)+1) - n > 0)
> fn = diff(FN(x,n), x)
> mean(n) = integral(fn(x, n), (x, 0, oo))
> mean(1)
>
> and I get:
>
> 1/((e + 1)*log(e + 1)^2 - 2*(e + 1)*log(e + 1) + e + 1)
>
> The answer I would expect is:
> 1/2
This is how I would have done this integral, but my output raises only
more questions:
sage: x = SR.var('x',domain='real')
sage: n = SR.var('n',domain='integer')
sage: assume(n > 1)
sage: F = 1/(1 + exp(-x))
sage: mean = integral((F^n).diff(x), (x, 0, infinity))
sage: mean
-n*(1/(2^n*n) - 1/((W2490^(1/n) + 1)^n*n))
sage: mean(n=1)
1/(W2490 + 1) - 1/2
Note that the answer is what you expect if you set W2490 (whatever that
is, wherever it came from) to zero:
sage: mean(n=1,W2490=0)
1/2
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-devel/a5217fb9-32fb-b601-6f73-546ccac54ea1%40orlitzky.com.