Message Boards Message Boards

GROUPS:

Definite and indefinite integrals and limits calculation time?

Posted 8 days ago
183 Views
|
4 Replies
|
1 Total Likes
|

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

4 Replies

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

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.

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.

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.

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