In[]:=
γ[t_]:=4I+Exp[I*t]
In[]:=
f[z_]:=
Sqrt[z]
z^2+16
◼
  • The following symbolic integration gives wrong result:
  • In[]:=
    Integrate[f[γ[t]]*γ'[t],{t,0,2Pi}]
    Out[]=
    0
    ◼
  • The numerical integration gives correct result:
  • In[]:=
    NIntegrate[f[γ[t]]*γ'[t],{t,0,2Pi}]
    Out[]=
    1.11072+1.11072
    ◼
  • With the residue theorem you get the correct result:
  • In[]:=
    2Pi*I*Residue[f[z],{z,4I}]
    Out[]=
    1
    2
    1/4
    (-1)
    π
    In[]:=
    N[%]
    Out[]=
    1.11072+1.11072