# Mathematica, Solving Complex Integral - Wrong solution

I know that

$$\int\limits_{-\infty}^\infty\frac{e^{itx}}{\pi (1+x^2)}\mathrm{d}x=e^{-|t|}$$

I wanted to verify this in Mathematica.

The computation of

Integrate[Exp[I*t*x]/(Pi*(1 + x^2)), {x,-Infinity,Infinity}]


doesn't work.

The Integration of

 Integrate[ComplexExpand[Exp[I*t*x]/(Pi*(1 + x^2))], {x,-Infinity,Infinity}]


does.

Fair enough.

I also know that $\int_{0}^\infty\frac{e^{itx}}{\pi (1+x^2)}\mathrm{d}x=\frac{1}{2}e^{-|t|}$ (note the integration from 0 to $\infty$)

Again,

    Integrate[Exp[I*t*x]/(Pi*(1 + x^2)), {x,0,Infinity}]


doesn't work.

But this time,

      Integrate[ComplexExpand[Exp[I*t*x]/(Pi*(1 + x^2))], {x,0,Infinity}]


yields

ConditionalExpression[ 1/2 (E^-Abs[t] + (
I t MeijerG[{{0}, {}}, {{0, 0}, {-(1/2)}}, t^2/4])/(
2 Sqrt[\[Pi]])), t \[Element] Reals]


I'm confused of what this MeijerG want to tell me and why it is there in the first place - the second term should be zero...

edit: of course, $t \in \mathrm{R}$

• Have you tried Integrate[Exp[I*t*x]/(Pi*(1 + x^2)), {x, -Infinity, Infinity}, Assumptions -> {t \[Element] Reals}] ? Commented Sep 18, 2017 at 18:50
• Thanks! This solves the problem with the ComplexExpand, but sadly not the second one with the MeijerG-function Commented Sep 18, 2017 at 19:02

Integrate[Exp[I*t*x]/(Pi*(1 + x^2)), {x, -Infinity, Infinity}]


ConditionalExpression[E^-Abs[t], t \ [Element] Reals]

If $\Im t \ne 0$, then the integral diverges.

Integrate[Exp[I*t*x]/(Pi*(1 + x^2)), {x, 0, Infinity}, Assumptions -> t \[Element] Reals]


1/2 (E^-Abs[t] + ( I MeijerG[{{1/2}, {}}, {{1/2, 1/2}, {0}}, t^2/4] Sign[t])/ Sqrt[[Pi]]

Let us verify it through

NIntegrate[Exp[I*x]/(Pi*(1 + x^2)), {x, 0, Infinity}]


0.18394 + 0.20587 I

• Thanks...so there is an imaginary part i was not aware of. Then I've got to find out why it is there. Commented Sep 18, 2017 at 20:19

For your first integral, you can just use FourierTransform:

FourierTransform[Sqrt[2Pi]/(Pi(1+x^2)),x,t]


E^-Abs[t]

For your second integral, what makes you think the imaginary part is 0? If you just want the real part of the integral you can use FourierCosTransform:

FourierCosTransform[Sqrt[Pi/2]/(Pi(1+x^2)),x,t]


E^-t/2

The factors of Sqrt[2 Pi] and Sqrt[Pi/2] are just to take care of the prefactors in the definitions of FourierTransform and FourierCosTransform.

• Thanks for the answer! Is it no zero? I have a (physically motivated) calculation in a book, where this is claimed Commented Sep 18, 2017 at 19:07
• I can't see why it would be 0. For the integral from -Infinity to Infinity, the imaginary part is 0 since it is an odd function of x. No such symmetry argument is available for the integral from 0 to Infinity. Commented Sep 18, 2017 at 19:23