2
$\begingroup$

I am trying to understand how Mathematica handles the Integral with complex limits.

NIntegrate[Exp[Sin[y]], {y, I, 2}]

How does NIntegrate works for this limits?

$\endgroup$
1
  • $\begingroup$ This question is closely related. Read the both answers in case of any doubts, namely you can choose any compact curve starting from I and ending in 2. $\endgroup$ – Artes Feb 7 '17 at 12:40
4
$\begingroup$

You can use EvaluationMonitor to see what points were sampled:

{res,data}=Reap[NIntegrate[Exp[Sin[y]],{y,I,2},EvaluationMonitor:>Sow[y]]];

Here is a plot of the data showing that NIntegrate uses a straight line contour:

enter image description here

Graphics[{PointSize[Large],Red,Point@@ReIm@data},Axes->True,AxesLabel->{Re,Im}]

Compare this to choosing a different contour:

{res,data}=Reap[NIntegrate[Exp[Sin[y]], {y, I, I+2, 2}, EvaluationMonitor:>Sow[y]]];
Graphics[{PointSize[Large],Red,Point@@ReIm@data},Axes->True,AxesLabel->{Re,Im}]

enter image description here

$\endgroup$

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.