(* residue090311.m [06p89] *)
r1=Residue[ 1/(1+z*z), {z, I}  ];

r2=Residue[ 1/(1+(z*z)^2), {z, Exp[I*Pi/4]}]
+ Residue[ 1/(1+(z*z)^2), {z, Exp[I*3*Pi/4]}];
r3=Residue[ 1/((1+z*z))^2, {z, I}  ];


Print["2Pi*I*r1= ",2*Pi*I*r1];

Print["2Pi*I*r3= ",2*Pi*I*r3];

f[z_]:= Exp[I*z]/((z-Pi/4)^2 + a*a);

Residue[ f[z], {z, Pi/4 +I*a}]


(* Print[2*Pi*I*r2, " Numeerinen = ", N[2*Pi*I*r2]] *)
(*

In[1]:=  <<residue090311.m
 

Pi

Pi
--
2


             3/4
        -(-1)
Out[1]= --------
              a
         2 a E



*)
