### Welcome to our community

#### youth4ever

##### New member
Hello my Math friends,

I have a complex integration problem:
The integral to calculate is :

Integrate[Cos [mx]/(x^2 + a^2), {x, -Infinity, Infinity}]
or if particularized for a=1, m=1 the integral will be :

Integrate[Cos [x]/(x^2 + 1), {x, -Infinity, Infinity}]

I know the answer for both of them:
(Pi/a)*(e^-ma) for the first
and
Pi/e for the second.

How this integral can be done through Complex integration ? I don't have a clue and I strongly wish to solve it.
Thanks.

PS: BTW, I would have written with math signs because I don't like the text style of writing math but I don't know how to do it here. Is there a trick ?

#### Opalg

##### MHB Oldtimer
Staff member
Hello my Math friends,

I have a complex integration problem:
The integral to calculate is :

Integrate[Cos [mx]/(x^2 + a^2), {x, -Infinity, Infinity}]
or if particularized for a=1, m=1 the integral will be :

Integrate[Cos [x]/(x^2 + 1), {x, -Infinity, Infinity}]

I know the answer for both of them:
(Pi/a)*(e^-ma) for the first
and
Pi/e for the second.

How this integral can be done through Complex integration ? I don't have a clue and I strongly wish to solve it.
Thanks.
Hi youth4ever and welcome to MHB!

Your integral is the real part of $$\displaystyle \int_{-\infty}^\infty \frac{e^{imx}}{x^2+a^2}dx.$$ If you know about contour integration then you should be able to evaluate that integral by using a D-shaped contour.

PS: BTW, I would have written with math signs because I don't like the text style of writing math but I don't know how to do it here. Is there a trick ?
See the LaTeX tips and tutorials forum.

#### youth4ever

##### New member
Hi Opalg,

Yes I know that it comes from e^imx/... integral. But I wondered if there is a way to simply integrate the cosine part separately by using a different technique and to double check the answer.
Is this possible ?

Thanks.

#### ThePerfectHacker

##### Well-known member
But I wondered if there is a way to simply integrate the cosine part separately by using a different technique and to double check the answer.
Is this possible ?
I think your question is. Rather than making things "complicated", why not just find anti-derivative of the function inside the integral and get the answer. But the problem with what you want is that a lot of these integration problems that use complex analysis to compute do not have anti-derivatives in terms of known standard functions. So what you want cannot be done.

#### Random Variable

##### Well-known member
MHB Math Helper
If your interested in a different approach that would confirm the answer you get using contour integration, consider the Laplace transform of $$\displaystyle f(t) = \int_{0}^{\infty} \frac{\cos (mtx)}{a^{2}+x^{2}} \ dx$$

Then by definition,

$$\mathcal{L}_{t} [f(t)](s) = \int_{0}^{\infty} \int_{0}^{\infty} \frac{\cos (mtx)}{a^{2}+x^{2}} \ e^{-st} \ dx \ dt = \int_{0}^{\infty} \frac{1}{a^{2}+x^{2}}\int_{0}^{\infty} \ \cos(mxt) e^{-st} dt \ dx$$

$$= \int_{0}^{\infty} \frac{1}{a^{2}+x^{2}} \frac{s}{s^{2}+(mx)^{2}} \ dx = \frac{s}{s^{2}-a^{2}m^{2}} \int_{0}^{\infty} \left( \frac{1}{a^{2}+x^{2}} - \frac{m^{2}}{s^{2}+m^{2}x^{2}} \right)$$

$$= \frac{s}{s^{2}-a^{2}m^{2}} \left( \frac{\pi}{2a} - \frac{\pi m }{2s} \right) = \frac{\pi}{2a(s+am)}$$

Now undo the transform.

EDIT: What I had previously after this point wasn't quite correct.

$$f(t) = \mathcal{L}^{-1}_{t} \Big[ \mathcal{L}_{t} [f(t)](s) \Big] = \mathcal{L}^{-1}_{t} \Big[ \frac{\pi}{2a(s+am)} \Big]$$

$$= \frac{\pi}{2a} \mathcal{L}^{-1}_{t} \Big[ \frac{1}{s+am} \Big] = \frac{\pi}{2a} e^{-amt}$$

And therefore,

$$\int_{-\infty}^{\infty} \frac{\cos (mx)}{a^{2}+x^{2}} \ dx = 2 f(1) = \frac{\pi}{a} e^{-am}$$

Last edited:

#### youth4ever

##### New member
Hello "Random Variable"

And many thanks for the solution. Your solution is incredible. I am amazed.
I have a question although.
How you knew at this point
$$= \int_{0}^{\infty} \frac{1}{a^{2}+x^{2}} \frac{s}{s^{2}+(mx)^{2}} \ dx$$
to amplify the product with
$$\frac{s^{2}-a^{2}m^{2}}{s^{2}-a^{2}m^{2}}$$
and then add and substract $$(mx)^{2}$$ to the numerator
to obtain the sum :
$$= \frac{s}{s^{2}-a^{2}m^{2}} \left( \frac{1}{a^{2}+x^{2}} - \frac{\ m^{2} }{s^{2}+(mx)^{2}} \right)$$
which is easily integrable in x variable? I just need a pattern on how to look because it is not obvious and I want to be able to apply this technique in similar situations.

Thanks.

Last edited:

#### Random Variable

##### Well-known member
MHB Math Helper
@youth4ever

I used partial fractions.

Assume that

$$\frac{1}{(a^{2}+x^{2})(s^{2}+m^{2}x^{2})} = \frac{Ax+B}{a^{2}+x^{2}} + \frac{Cx+D}{s^{2}+m^{2}x^{2}}$$

$$= \frac{As^{2}x + Am^{2}x^{3} + Bs^{2} + Bm^{2}x^{2} + Ca^{2}x + Cx^{3} + Da^{2} + Dx^{2}}{(a^{2}+x^{2})(s^{2}+m^{2}x^{2})}$$

If those fractions are equal, their numerators must be the same.

That leads to four equations that must be satisfied.

$$Am^{2} + C = 0$$
$$Bm^{2} + D = 0$$
$$As^{2}+Ca= 0$$
$$Bs^{2}+Da^{2} =1$$

The first and third equations imply that $A$ and $C$ are zero.

Solving the second equation for $D$ and plugging it into equation 4, we get

$$Bs^{2} - Bm^{2} a^{2} = 1 \implies B = \frac{1}{s^{2}-m^{2}a^{2}}$$

Then from equation 2,

$$D = -\frac{m^{2}}{s^{2}-m^{2}a^{2}}$$

#### youth4ever

##### New member
@Random Variable
Thanks again.

How you would approach a problem like the following :
It come from the Fourier transform of the sinc function without the coefficient.
$$\int_{0}^{\infty} \frac{sin (ak)}{ak} e^{ikx} \ dk$$
Without the exponential term hanged there that would be easy and is convergent too as the sinc function dies at Infinity. But the complex exponential term introduces another cyclicity to the function so it may be regarded as non convergent because of the 0 and Infinity limits.
However I want to believe that this can be done through complex integration.
Or if not, we could take limits to be from Pi/2 to Pi for example.

What do you think ?

Last edited: