0
$\begingroup$

I'm trying to compute an integral of f(x,y) such that an integration over "y" is performed inside the integral over "x". My trial is below:

NIntegrate[
 1 - Exp[-10^12*0.00085*
    NIntegrate[
     0.00015*Exp[-y^2]/(
      2.21*10^-7 + (((3*10^10)/x - 2.47*10^15)/(1.06*10^11) - 
         y)^2), {y, -\[Infinity], \[Infinity]}, 
     AccuracyGoal -> \[Infinity], 
     MaxRecursion -> 200]*1.2*10^-9], {x, 0, 10^-3}, 
 AccuracyGoal -> \[Infinity], MaxRecursion -> 200, 
 WorkingPrecision -> 100]

Most likely I have a "non-numerical values for all sampling points in the region" error because internal NIntegrate call does not recognize "x" and hence cannot proceed with evaluation. I've tried defining the whole integrand as a function of "x" via

f(x_?NumericQ):= ...

and then integrating it but with no luck. I also tried using Range to define "x" in a "matlabish" way to no avail.

Could someone please help me sort these out? Thanks!

P.S. What puzzles me is that if I call "Plot" instead of NIntegrate (deleting irrelevant options), then all of a sudden it outputs something that looks pretty like an integrand.

$\endgroup$
3
$\begingroup$

How about this?

nint[x_?NumericQ] := 
 NIntegrate[
  0.00015*
   Exp[-y^2]/(2.21*10^-7 + (((3*10^10)/x - 2.47*10^15)/(1.06*10^11) - 
         y)^2), {y, -\[Infinity], \[Infinity]}]

e.g.,

nint[.003]


NIntegrate[1 - Exp[-10^12*0.00085*nint[x]*1.2*10^-9], {x, 0, 10^(-3)}]

Usually, when I see exponentiation in an integral, I'll try to scale things so that Exp[big numbers] are avoided. But this seems to work.

$\endgroup$
1
  • $\begingroup$ Yes it does - thanks for the idea! $\endgroup$
    – Sasha
    Jun 20 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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