7
$\begingroup$

I want to obtain value of following integral to a high precision (say 30 digits),

NIntegrate[DawsonF[Sqrt[t]]^2/t, {t, 0, Infinity}]

Graph of integrand looks like this: enter image description here. There is no singularity whatsoever. When $t$ is large, integrand is of order $O(1/t^2)$, so the integral converge.


However, Mathematica seems unable to evaluate it to high precision. In version 14.1, it raises error when WorkingPrecision is over 30, even complains the integrand is not numeric. enter image description here

Maple on other hand, can do this smoothly: NIntegrate[DawsonF[Sqrt[t]]^2/t, {t, 0, Infinity},
WorkingPrecision -> 30]


Is this a bug of NIntegrate? Any idea or suggestion is welcomed.

$\endgroup$
2
  • $\begingroup$ There might be some other options needed. But if you evaluate it exactly, then using N[exact,80] now it gives same result as Maple with no problems. i.sstatic.net/K6nIL7Gy.png 0.91596559417721901505460351493238411077414937428167213426649811962176301977625477 $\endgroup$
    – Nasser
    Commented yesterday
  • 1
    $\begingroup$ @Nasser Thank you for the comment. Actually my real problems are more complicated integrals involving DawsonF that Integrate cannot solve exactly (e.g. replace square by cube, 4th power etc). The above is a toy example to illustrate the problem I encountered when using NIntegrate on them. $\endgroup$
    – pisco
    Commented yesterday

2 Answers 2

8
$\begingroup$

Using @CarlWoll's answer to Terrible accuracy of DawsonF (which Q&A makes one suspect at least part of the problem is with DawsonF[]):

(*https://mathematica.stackexchange.com/a/182691*)
dawsonF[x_] := -(I/2) E^-x^2 Sqrt[\[Pi]] + I HermiteH[-1, I x]

NIntegrate[dawsonF[Sqrt[t]]^2/t, {t, 0, Infinity}, 
  WorkingPrecision -> 160, MaxRecursion -> 20] // N[#, 80] &
(*
0.91596559417721901505460351493238411077414937428167213426649811962176301977625477
*)
$\endgroup$
2
$\begingroup$
$Version

(* "14.1.0 for Mac OS X ARM (64-bit) (July 16, 2024)" *)

Clear["Global`*"]

For comparison,

int = Integrate[DawsonF[Sqrt[t]]^2/t, {t, 0, Infinity}]

(* Catalan *)

intN = NIntegrate[DawsonF[Sqrt[t]]^2/t, {t, 0, Infinity},
  WorkingPrecision -> 30,
  MaxRecursion -> 25,
  MinRecursion -> 25]

(* 0.915965594177219015054603514932 *)

int - intN

(* 0.*10^-31 *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.