9
$\begingroup$

I want to use Mathematica to compute the following complex integral:

Integrate[Exp[I z ] 1/z, {z, -Infinity, Infinity}]

Mathematica reports that it does not converge on {-Infinity, Infinity}.

But, from the textbook, we know, the result is I Pi.

Of course, if I use NIntegrate, then, Mathematica will give 0. + 3.14 I.

$\endgroup$
9
$\begingroup$

Try

Integrate[Exp[I z] 1/z, {z, -Infinity, Infinity},PrincipalValue -> True]
(*I π*)
$\endgroup$
9
$\begingroup$

One can also consider using the residue theorem. The residue is readily obtained by

Residue[Exp[I z] 1/z, {z, 0}]

returning 1, which means that the integral is $ \mathrm i \pi $.

$\endgroup$
5
$\begingroup$

If you are sure about your integral's behavior you can try

Integrate[Exp[I z] 1/z, {z, -Infinity, Infinity}, 
 GenerateConditions -> False]
(* I π *)
$\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.