# Inconsistent behaviour of Integrate involving EllipticK?

$Version Integrate[1/Sqrt[1-x^2+x^4],{x,0,t},Assumptions->t>0]/.t->10.*^5 NIntegrate[1/Sqrt[1-x^2+x^4],{x,0,Infinity}] Integrate[1/Sqrt[1-x^2+x^4],{x,0,Infinity}] Out[]//N  The result of Integrate + Limit agrees with that of NIntegrate. But Integrate + N seems give the wrong result, since the integrand is positive. This integral is a quite standard elliptic integral. Is it a severe bug of Integrate? Any workaround? see also Buggy behavior of EllipticE[0,k] with arbitrary precision input Buggy behavior of EllipticK with arbitrary precision input and$MinPrecision

• Apparently a bug in Limit and not Integrate per se. In[3]:= InputForm[ii = Integrate[1/Sqrt[1-x^2+x^4],{x,0,t},Assumptions->t>0]] Out[3]//InputForm= -((-1)^(1/6)*Sqrt[1 - (-1)^(1/3)*t^2]* Sqrt[(1 + (-1)^(2/3)*t^2)/(1 - t^2 + t^4)]* EllipticF[I*ArcSinh[(-1)^(1/3)*t], (-1)^(2/3)]) In[4]:= InputForm[lii = Limit[ii, t->Infinity]] Out[4]//InputForm= (-1)^(1/6)*(Im[EllipticK[(3 - I*Sqrt[3])/2]] - I*Re[EllipticK[(3 - I*Sqrt[3])/2]]) In[5]:= N[lii] Out[5]= 0. - 1.68575 I Aug 6, 2023 at 17:11
• ... which in turn is due to a Series glitch. In[9]:= nss = Normal[Series[ii, {t,Infinity,0}, Assumptions->t>1000]] 2/3 2/3 Out[9]= -((-1) EllipticK[1 - (-1) ]) In[10]:= N[nss] -16 Out[10]= -2.22045 10 - 1.68575 I  Aug 6, 2023 at 17:14

As shown by @Daniel Lichtblau, this is due to bug of Limit, see also tutorial/SomeNotesOnInternalImplementation#7441:
Hence a simple workaround is to pull Infinity back to finite position, e.g. $$x=\tan t$$,
Inactive[Integrate][1/Sqrt[1-x^2+x^4],{x,0,Infinity}]//