# Definite integration in mathematica

I tried to integrate the following in Mathematica.

$\int\limits_{-\infty}^\infty\cfrac{\text{e}^{\text{i}ax}}{x^2-b^2}\text{d}x$ where $a,b>0$

The analytical result is well known.

$-\cfrac{\pi}{b}\sin(ab)$

I used the following code

Integrate[E^(I a x)/(x^2 - b^2), {x, -Infinity, Infinity},
Assumptions->{a > 0, b != 0, b ∈ Reals}]


But Mathematica returned something else

-((π (I Abs[b] Cos[a b] + b Sin[a b]))/b^2)


How can I get the above analytical expression?

• Well, if your assumption is that $b>0$, then why did you only specify b != 0 in your assumptions to Integrate? Have you tried specifying that b is positive, rather than nonzero? – MarcoB Apr 29 '16 at 14:18
• @MarcoB The assumptions should be fine. b != 0 && b ∈ Reals is equivalent to b > 0 since the integral only has b^2. – Chip Hurst Apr 29 '16 at 14:19
• @MarcoB : Yes I have used Assumptions -> {a > 0, b > 0, b \[Element] Reals}. But then it fails to converge. – Soumyajit Roy Apr 29 '16 at 14:24
• Solving the indefinite integral and then using limit gives -((2 π Sin[a b])/b). – JungHwan Min Apr 29 '16 at 14:34
• Mathematica claims the integral diverges because, well, it diverges. So that's not a good way to get the Fourier transform of 1/(x^2-b^2). To get the FT one can do In[14]:= FullSimplify[ Sqrt[2*Pi]* FourierTransform[1/(x^2 - b^2), x, a, Assumptions -> {a > 0, b != 0, Element[b, Reals]}]] Out[14]= -((\[Pi] Sin[a b])/b) – Daniel Lichtblau Apr 29 '16 at 15:53

Sometimes they're equal:

Block[{a = 2, b = 4},
{NIntegrate[E^(I a x)/(x^2 - b^2),
{x, -Infinity, -b - I, b + I, Infinity}],
-((π (I Abs[b] Cos[a b] + b Sin[a b]))/b^2) // N}
]
(*
{-0.77704 + 0.114275 I, -0.77704 + 0.114275 I}
*)


Kidding aside, perhaps you should specify PrincipalValue -> True (which I just noticed, belatedly, than Daniel Lichtblau suggested in a comment). After a cup of coffee, the following returns with the desired answer:

Integrate[E^(I a x)/(x^2 - b^2), {x, -Infinity, Infinity},
Assumptions -> {a > 0, b != 0, b ∈ Reals, x ∈ Reals}, PrincipalValue -> True]
(*
-((π Sin[a b])/b)
*)

• Thanks a lot. Use of PricipalValue solves the problem. – Soumyajit Roy Apr 30 '16 at 10:36
• Must have been one big cup, or else your computer is much faster than mine. – Daniel Lichtblau Apr 30 '16 at 22:07

This integral has not a value in Riemann's sense, then it has not a value independent of your particular problem, as many people already commented above. Hence, it is better to use the residue theorem, and decide whether you want to include the residue from the pole at +b, at -b, both ou none. Therefore:

rplus = Residue[E^(I a x)/(x^2 - b^2), {x, b}]
rminus = Residue[E^(I a x)/(x^2 - b^2), {x, -b}]


2 Pi I (rplus + rminus) // FullSimplify

-((2 \[Pi] Sin[a b])/b)