Message Boards Message Boards

0
|
3153 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Definite and indefinite integrals and limits calculation time?

Posted 3 years ago

Hi, I'm looking at the derivatives of the logistic sigmoid as a vector space with a norm induced by the logistic density. In the attached Notebook, I have two functions: ntgl and defNtgl. which compute the indefinite and definite (-Infinity,Infinity) integrals.
As you can see from the notebook, both the indefinite integral and their limits as t->+/-Infinity of the integral are fast to compute (easy to eyeball from the indefinite integrals). The definite integrals takes MUCH longer and fail (time out) in many cases. This seems strange to me and as a newbie, I thought I would ask whether this is a common issue with perhaps a known workaround. Any thoughts would be appreciated. --Len B

POSTED BY: Len Berman
4 Replies

Indefinite integration is generally easier, because it can ignore singularities, convergence and branch cuts.

POSTED BY: Gianluca Gorni
Posted 3 years ago

I understand the increased complexity of definite integrals; however, the example I gave is real and non-singular. I am attaching another notebook which illustrates what appears to be a related problem: the integral of a real function over the line has an imaginary component.

POSTED BY: Len Berman

It may be inconvenient, but it is not wrong. An imaginary-valued function can very well have a real derivative. For example

In[22]:= D[Log[-t^2], t]

Out[22]= 2/t

If you insist on a real-valued primitive, here is a trick:

In[23]:= D[1/2 Log[(-t^2)^2], t]

Out[23]= 2/t

You may also introduce Abs or RealAbs into the formulas with logarithms.

POSTED BY: Gianluca Gorni

Indefinite integrals are only well defined up to (piecewise) constant of integration.

As for speeding up the definite integrals (or Limit), it might help to give an explicit assumption along the lines Assumptions->s>0.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract