Group Abstract Group Abstract

Message Boards Message Boards

0
|
83 Views
|
3 Replies
|
1 Total Like
View groups...
Share
Share this post:

Elliptic integrals: built-in vs. explicit integration

Posted 2 days ago

Hello everyone!

Why the difference between two elliptic integrals calculated using the built-in functions (EllipticK, EllipticF) is different from the result I obtain when I perform the explicit integration of the integrand function?
In the following an example of what I mean:

Using the built-in functions:

In[1]:= EllipticK[0.00674^2]

Out[1]= 1.57081

In[2]:= EllipticF[0.6517, 0.00674^2]

Out[2]= 0.651702

In[3]:= EllipticK[0.00674^2] - EllipticF[0.6517, 0.00674^2]

Out[3]= 0.919112

Using the explicit integration of the integrand function the complete and incomplete elliptic integrals correspond with the ones calculated with the built-in functions (neglecting the imaginary parts), but the integral between the extremes of integration corresponding to the difference of the wo integrals results different (-0.651702 instead of 0.919112):

In[4]:= f5[x_] := 1/Sqrt[1 - 0.00674^2*(Sin[x])^2]

In[5]:= Integrate[f5[x], {x, 0, Pi/2}]

Out[5]= 1.57081

In[6]:= Integrate[f5[x], {x, 0, 0.6517}]

Out[6]= 0.651702 + 3.66037*10^-18 I

In[7]:= Integrate[f5[x], {x, 0.6517, Pi/2}]

Out[7]= -0.651702 - 3.36193*10^-16 I

Where am I in wrong?

Many thanks!

POSTED BY: Davide Gardini
3 Replies

I tried now with version 12.3, and I get wrong outputs too, although different from yours. One must always check results with NIntegrate.

I hope we get a clarification from insiders.

POSTED BY: Gianluca Gorni

Hi Gianluca! I'm using 13.2 version. Do you think that there is a bug in the older software? Thanks for your interest.

POSTED BY: Davide Gardini

Using version 14.2 for Out[7] I get 0.919112 as expected, and no imaginary part in Out[6]. What version are you using?

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