Elliptic integrals: built-in vs. explicit integration

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!

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?

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

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.

Thank you very much for your verification and (unfortunately) confirmation of the problem encoutered with previous versions.
Thanks also for the advice to check the results with NIntegrate.
We will see if the insiders can give us a feedback.

One very generic advice for symbolic integration is to use Integrate with exact input only. You gave it floating-point parameters, and it may have helped choose the wrong path. Or it may not; only an insider can tell.