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$ Commented Feb 7, 2017 at 12:40

1 Answer 1

5
$\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$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.