From: David S. <d.s...@go...> - 2019-03-13 13:53:32
|
Interestingly, during definite integration a much "simpler" antiderivative is used (see below). It doesn't involve the complex conjugate function and also doesn't need atan2. Differentiating it shows that it is correct. I'm trying to find out what part of the code makes it so much more complicated and why. From what I can see with tracing: 1.) $integrate calls sinint 2.) sinint calls rischint 3.) rischint fails, exponentializes and calls $integrate again 4.) $integrate calls sinint again on the exponentialized expression 5.) sinint now succeeds and gives the "simple" antiderivative 6.) rischint does something with it, turning it into the more complicated version with complex conjugate and atan2 7.) $integrate returns the complicated antiderivative Does anyone know why rischint makes the antiderivative more complicated? This is the antiderivative used internally during definite integration: (%e^-(1/4)*(%i*gamma_incomplete(1,((-2*x)-%i)^2/4)-(gamma_incomplete(1/2,((-2*x)-%i)^2/4)*((-2*x)-%i))/(2*sqrt(((-2*x)-%i)^2))))/2-(%e^-(1/4)*((gamma_incomplete(1/2,(%i-2*x)^2/4)*(%i-2*x))/(2*sqrt((%i-2*x)^2))+%i*gamma_incomplete(1,(%i-2*x)^2/4))) Best regards David Scherfgen Am Di., 12. März 2019 um 22:21 Uhr schrieb Barton Willis <wi...@un...>: > > > By the way, the antiderivative that Maxima spits out is extremely > complicated compared > > > Yeah--the antiderivative involves the complex conjugate function. As a > function from Complex --> Complex, it's not differentiable. > > > --Barton > ------------------------------ > *From:* David Scherfgen via Maxima-discuss < > max...@li...> > *Sent:* Monday, March 11, 2019 7:13:02 AM > *To:* <max...@li...> > *Subject:* [Maxima-discuss] A fix to limit broke certain improper > integrals > > Good day! > > In 2018 Dan Gildea fixed a bug in limit (see > https://sourceforge.net/p/maxima/bugs/3459/ > <https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_maxima_bugs_3459_&d=DwMFaQ&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=Ln0CjFotuA7GyhsRS-QpQA&m=TzcAxzQ-5sa8n5gZi2do2RBOiOyNkn7Qld3sO2R6qKo&s=RMO-P96juD8F9ja3R4c-OY-hrQ3LveMsLLmV9XFi2DM&e=>). > Unfortunately this fix broke certain improper integrals, like this one: > > integrate(x * exp(-x^2) * sin(x), x, -inf, inf); > > Which now gives 0. > Zero is clearly wrong because the function is even and non-zero. The > correct answer would be 2*sqrt(%pi)*%e^(-1/4). Prior to Dan's fix, this was > the answer Maxima was giving. > > It seems like prior to the fix, Maxima was not able to compute the limit > of the antiderivative for x --> +/-inf, and so it used some other method to > get to the result. With the current version, the limit succeeds and gives > zero for x --> +inf and x --> -inf. > > Does anyone have a proposal on how we can fix this? > > By the way, the antiderivative that Maxima spits out is extremely > complicated compared to the one that Wolfram Alpha gives. For what it's > worth, it cannot even take the derivative of it! So I'm surprised that it > can compute the limit for it. > > Best regards > David Scherfgen > |