Mathematica showing strange output for elliptic integral

Click For Summary
SUMMARY

The forum discussion centers on an issue encountered in Mathematica when evaluating the integral \(\int_{\frac{\pi}{6}}^{\frac{\pi}{2}}\frac{1}{\sqrt{\sin t}}\:\mathrm{d}t\). The user found that Mathematica returned a result with a small imaginary component, specifically \(2\cdot \mathrm{F}\left(\frac{\pi}{6},2\right) \approx 1.16817 - 9.26622\cdot10^{-17}\mathrm{i}\), while their manual calculation yielded a real number equivalent to \(\sqrt{2}\cdot \mathrm{F}\left(\frac{\pi}{4},\frac{1}{4}\right) \approx 1.16817\). The discussion highlights a known issue in Mathematica where small imaginary parts can arise due to rounding errors in numerical computations.

PREREQUISITES
  • Understanding of elliptic integrals, specifically the function \(\mathrm{F}\)
  • Familiarity with Mathematica version 12.3 or later for accurate results
  • Basic knowledge of calculus and integral evaluation
  • Awareness of numerical analysis concepts, particularly rounding errors
NEXT STEPS
  • Explore the properties and applications of elliptic integrals in Mathematica
  • Investigate methods to mitigate rounding errors in numerical computations
  • Learn about the differences between symbolic and numerical evaluation in Mathematica
  • Study the implications of complex results in real-valued integrals
USEFUL FOR

Mathematics students, researchers using Mathematica for numerical analysis, and professionals dealing with elliptic integrals and numerical computation errors.

springo
Messages
125
Reaction score
0
Hi,
I was studying calculus and I had a problem while checking my results.

I came to the following result:
\int_{\frac{\pi}{6}}^{\frac{\pi}{2}}\frac{1}{\sqrt{\sin t}}\:\mathrm{d}t = \sqrt{2}\cdot \mathrm{F}\left(\frac{\pi}{4},\frac{1}{4}\right) \approx1.16817

However, Mathematica shows:
\int_{\frac{\pi}{6}}^{\frac{\pi}{2}}\frac{1}{\sqrt{\sin t}}\:\mathrm{d}t = 2\cdot \mathrm{F}\left(\frac{\pi}{6},2\right) \approx1.16817-9.26622\cdot10^{-17}\mathrm{i}
The results are almost identical (numerically) and I believe I didn't make any mistakes... is there a problem with Mathematica here?

Thanks for your help.

PS: Sorry for not using the template but it didn't make much sense here...
 
Physics news on Phys.org
Well, the integral should definitely be a real number. It is a common problem with Mathematica that small imaginary parts appear due to rounding errors.
 

Similar threads

  • · Replies 105 ·
4
Replies
105
Views
11K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K