Question

I want to carry out a numeric integration using Mathematica. The integrand is

I=Exp[-z^2]F[z]^2

where this F[z] is defined as Integrate[1/(q+I) Exp[-c(q+z)^2],{q,-Infinity,0}]. Since Mathematica does not know how to carry out the Integration, it has to be carried out numerically. I have to change the integration into 'NIntegrate'. It seems to me that Mathematica refuses to do numerical integration over another numerical integration. The reason I am not using NIntegrate over multi-variables is that the actual integrand is long and complicated which involve F[z].

I also wonder if we could define our own special function like the build-in function in Mathematica. Since error function is an integration and Mathematica does not complain when Numerical integrate over error function. Can I transform the F[z] here like a built-in function?

Many Thanks

No correct solution

OTHER TIPS

In[1]:= c = 2; (* make sure all variables have constant values assigned *)
F[z_?NumericQ] := NIntegrate[1/(q + I) Exp[-c (q + z)^2], {q, -Infinity, 0}];
NIntegrate[Exp[-z^2] F[z]^2, {z, 1, 3}]

Out[3]= 0.00387755 + 0.0794878 I
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top