Bug in integrate

25 views
Skip to first unread message

Laurent Decreusefond

unread,
Apr 26, 2016, 10:41:44 AM4/26/16
to sage-s...@googlegroups.com
Hi everybody,

here is the result of my session on Sage 7.2 beta0 (but I guess the problem is not specific to that version)

sage: var('t')
t
sage: integrate(exp(-2*t)/(1-exp(-2*t)),t)
1/2*log(e^(-2*t) - 1)

What does mean log(-1+e^(-2*t)) since the argument is negative ?

Nils Bruin

unread,
Apr 26, 2016, 12:03:03 PM4/26/16
to sage-support

On Tuesday, April 26, 2016 at 7:41:44 AM UTC-7, Laurent Decreusefond wrote:

What does mean log(-1+e^(-2*t)) since the argument is negative ?

For t<0 that expression takes real values, so there the answer even makes sense in a real setting. The answer is generally correct for complex values t. You have to be careful that log is a multi-valued function, though, so if you want to use this antiderivative to compute definite integrals, you have to take care that appropriate branches are chosen. Luckily, for t>0 the branch choice seems consistent, so:

sage: I=integrate(exp(-2*t)/(1-exp(-2*t)),t)
sage: (I(t=2)-I(t=1)).n()
0.0634640055214862

looks like a reasonable answer.


Reply all
Reply to author
Forward
0 new messages