Evaluating example definite integral on the infinite domain using contour integration

In this article, we shall evaluate the following integral using contour integration methods.

I=x2cosmx(x4+a4)2dx I = \int_{-\infty}^{\infty} \dfrac{x^2\cos{mx}}{(x^4+a^4)^2} dx

Contour and integrand hunting

Our first couple of questions, which are impossible to separate from one another as they are closely connected, is which curve and which integrand should we use to determine the value of II? The contour and integrand should satisfy the following criteria:

  1. The contour must have a component whose line integral evaluates to either II, or 0x2cosmx(x4+a4)2dx=12I\displaystyle \int_{0}^{\infty} \dfrac{x^2\cos{mx}}{(x^4+a^4)^2} dx = \dfrac{1}{2} I (thanks to the symmetry of our integrand). It is also OK if II or half II is only stored in the real or imaginary part of the integral along this segment, and there's another value in the other part of the integral for this segment.

  2. All other components of the contour must either only contribute to a separate part of the result (e.g. if II is stored in the real part of the solution, the other parts of the integral may only contribute to the imaginary part of the solution), or equal 0.

  3. There must be no singularities of our integrand along this contour.

  4. The only singularities allowed within the region enclosed by the contour are poles.

One curve and integrand that would satisfy these criteria is the infinite semi-circle that covers the entire positive yy-axis, but does not cover any of the negative yy-axis and is centred on the origin. Namely, this curve:

with this contour integral:

Cz2eimz(z4+a4)2dz. \oint_C \dfrac{z^2 e^{imz}}{(z^4+a^4)^2} dz.

Evaluating the contour integral

The residue theorem tells us that our contour integral will equal 2πiresidues2\pi i \sum \mathrm{residues}. These residues will correspond to when the denominator of our integrand equals zero, that is when:

z4+a4=0z4=a4z4=a4(1)zn4=a4eπi+2πin,nZzn=aeπi(1+2n)4. \begin{aligned} z^4+a^4 &= 0 \\ z^4 &= -a^4 \\ z^4 &= a^4 \cdot (-1) \\ z^4_n &= a^4 e^{\pi i + 2\pi i n}, \hspace{0.1cm} n\in \mathbb{Z} \\ z_n &= a e^{\dfrac{\pi i(1+2n)}{4}}. \end{aligned}

n=0,1,2,3n=0, 1, 2, 3 gives us the only unique roots of the denominator and hence our only poles. It is also important to note that z4+a4=(zz0)(zz1)(zz2)(zz3)z^4+a^4 = (z-z_0)(z-z_1)(z-z_2)(z-z_3). Of these poles, only z0z_0 (znz_n for n=0n=0) and z1z_1 lie within the region enclosed by C. Both these poles will be second order, as to remove the singularity, our integrand will need to be multiplied by (zzn)2(z-z_n)^2.

The general formula for calculating residues is (where pp is a pole of order kk in the function, f(z)f(z)):

residue=limzp1(k1)!dk1dzk1((zp)kf(z)) \begin{aligned} \mathrm{residue} = \lim_{z\rightarrow p} \dfrac{1}{(k-1)!} \dfrac{d^{k-1}}{dz^{k-1}} \left((z-p)^k f(z)\right) \end{aligned}

For z0z_0, the residue r0r_0 is:

r0=limzz01(21)!d21dz21((zz0)2z2eimz(z4+a4)2)=limzz0ddz(z2eimz(zz1)2(zz2)2(zz3)2)=limzz02zeimz(zz1)2(zz2)2(zz3)2+imz2eimz(zz1)2(zz2)2(zz3)22z2eimz(zz1)2(zz2)2(zz3)2(1zz1+1zz2+1zz3)=limzz0zeimz(zz1)2(zz2)2(zz3)2(2+imz2z(1zz1+1zz2+1zz3))=z0eimz0(z0z1)2(z0z2)2(z0z3)2(2+imz02z0(1z0z1+1z0z2+1z0z3)) \begin{aligned} r_0 &= \lim_{z\rightarrow z_0} \dfrac{1}{(2-1)!} \dfrac{d^{2-1}}{dz^{2-1}} \left((z-z_0)^2 \dfrac{z^2e^{imz}}{(z^4+a^4)^2}\right) \\ &= \lim_{z\rightarrow z_0} \dfrac{d}{dz} \left(\dfrac{z^2 e^{imz}}{(z-z_1)^2(z-z_2)^2(z-z_3)^2}\right) \\ &= \lim_{z\rightarrow z_0} \dfrac{2ze^{imz}}{(z-z_1)^2(z-z_2)^2(z-z_3)^2} + \dfrac{imz^2 e^{imz}}{(z-z_1)^2(z-z_2)^2(z-z_3)^2} - \dfrac{2z^2e^{imz}}{(z-z_1)^2(z-z_2)^2(z-z_3)^2} \\\left(\dfrac{1}{z-z_1}+\dfrac{1}{z-z_2}+\dfrac{1}{z-z_3}\right) \\ &= \lim_{z\rightarrow z_0} \dfrac{ze^{imz}}{(z-z_1)^2(z-z_2)^2(z-z_3)^2} \left(2+imz-2z\left(\dfrac{1}{z-z_1}+\dfrac{1}{z-z_2}+\dfrac{1}{z-z_3}\right)\right) \\ &= \dfrac{z_0 e^{imz_0}}{(z_0-z_1)^2(z_0-z_2)^2(z_0-z_3)^2} \left(2 + imz_0 - 2z_0 \left(\dfrac{1}{z_0-z_1}+\dfrac{1}{z_0-z_2}+\dfrac{1}{z_0-z_3}\right)\right) \end{aligned}

To simplify our above equation, we need to simplify our denominators:

z0z1=a(eπi4e3πi4)=aeπi4(1eπi2)=aeπi4(1i)=aeπi42eπi4=a2.z0z2=a(eπi4e5πi4)=aeπi4(1eπi)=aeπi4(1(1))=2aeπi4.z0z3=a(eπi4e7πi4)=aeπi4(1e3πi2)=aeπi4(1(i))=aeπi4(1+i)=aeπi42eπi4=a2eπi2=a2i. \begin{aligned} z_0-z_1 &= a \left(e^{\dfrac{\pi i}{4}} - e^{\dfrac{3\pi i}{4}}\right) \\ &= ae^{\dfrac{\pi i}{4}} \left(1-e^{\dfrac{\pi i}{2}}\right) \\ &= ae^{\dfrac{\pi i}{4}} (1-i) \\ &= ae^{\dfrac{\pi i}{4}} \sqrt{2} e^{-\dfrac{\pi i}{4}} \\ &= a\sqrt{2}.\\ z_0 - z_2 &= a \left(e^{\dfrac{\pi i}{4}} - e^{\dfrac{5\pi i}{4}}\right) \\ &= ae^{\dfrac{\pi i}{4}} \left(1-e^{\pi i}\right) \\ &= ae^{\dfrac{\pi i}{4}} (1 - (-1)) \\ &= 2ae^{\dfrac{\pi i}{4}}.\\ z_0 - z_3 &= a \left(e^{\dfrac{\pi i}{4}} - e^{\dfrac{7\pi i}{4}}\right) \\ &= ae^{\dfrac{\pi i}{4}} \left(1-e^{\dfrac{3\pi i}{2}}\right) \\ &= ae^{\dfrac{\pi i}{4}} (1 - (-i))\\ &= ae^{\dfrac{\pi i}{4}} (1+i) \\ &= ae^{\dfrac{\pi i}{4}} \sqrt{2} e^{\dfrac{\pi i}{4}} \\ &= a\sqrt{2} e^{\dfrac{\pi i}{2}} \\ &= a\sqrt{2} i. \end{aligned}

Likewise, iz0=eπi2aeπi4=ae3πi4=a2(1+i)iz_0 = e^{\dfrac{\pi i}{2}} \cdot ae^{\dfrac{\pi i}{4}} = ae^{\dfrac{3\pi i}{4}} = \dfrac{a}{\sqrt{2}} (-1+i).

r0=aeπi4eam2(1+i)2a24a2eπi22a2eπi(2+am2(1+i)2aeπi4(1a2+12aeπi4+1a2eπi2))=e5πi4eam2(1+i)16a5(2+am2(1+i)2eπi412eπi4) \begin{aligned} r_0 &= \dfrac{ae^{\dfrac{\pi i}{4}} e^{\dfrac{am}{\sqrt{2}}(-1+i)}}{2a^2 \cdot 4a^2e^{\dfrac{\pi i}{2}} \cdot 2a^2 e^{\pi i}} \left(2+\dfrac{am}{\sqrt{2}}(-1+i) - 2ae^{\dfrac{\pi i}{4}}\left(\dfrac{1}{a\sqrt{2}} + \dfrac{1}{2ae^{\dfrac{\pi i}{4}}} + \dfrac{1}{a\sqrt{2}e^{\dfrac{\pi i}{2}}}\right)\right) \\ &= \dfrac{e^{-\dfrac{5\pi i}{4}} e^{\dfrac{am}{\sqrt{2}}(-1+i)}}{16a^5} \left(2+\dfrac{am}{\sqrt{2}}(-1+i) - \sqrt{2}e^{\dfrac{\pi i}{4}} - 1 - \sqrt{2}e^{-\dfrac{\pi i}{4}}\right) \\ \end{aligned}

Using: eπi4+eπi4=2e^{\dfrac{\pi i}{4}} + e^{-\dfrac{\pi i}{4}} = \sqrt{2} and e5πi4=e3πi4e^{-\dfrac{5\pi i}{4}} = e^{\dfrac{3\pi i}{4}}, we can rewrite the above expression as:

r0=e3πi4eam2(1+i)16a5(am2(1+i)1)=eam2(1+i)16a52(am2(1+i)2(1+i))=eam2(1+i)16a52(am22i+1i)=eam2(1+i)16a52(i(am2+1)+1) \begin{aligned} r_0 &= \dfrac{e^{\dfrac{3\pi i}{4}} e^{\dfrac{am}{\sqrt{2}}(-1+i)}}{16a^5} \left(\dfrac{am}{\sqrt{2}}(-1+i) -1\right) \\ &= \dfrac{e^{\dfrac{am}{\sqrt{2}}(-1+i)}}{16a^5\sqrt{2}}\left(\dfrac{am}{\sqrt{2}}(-1+i)^2 - (-1+i)\right) \\ &= \dfrac{e^{\dfrac{am}{\sqrt{2}}(-1+i)}}{16a^5\sqrt{2}}\left(\dfrac{am}{\sqrt{2}}\cdot -2i+1-i\right) \\ &= \dfrac{e^{\dfrac{am}{\sqrt{2}}(-1+i)}}{16a^5\sqrt{2}}\left(-i\left(am\sqrt{2}+1\right)+1\right) \end{aligned}

Next, we must find r1r_1.

r1=limzz1ddz((zz1)2z2eimz(z4+a4)2)=limzz1ddz(z2eimz(zz0)2(zz2)2(zz3)2)=limzz12zeimz(zz0)2(zz2)2(zz3)2+imz2eimz(zz0)2(zz2)2(zz3)22z2eimz(zz0)2(zz2)2(zz3)2(1zz0+1zz2+1zz3)=limzz1zeimz(zz0)2(zz2)2(zz3)2(2+imz2z(1zz0+1zz2+1zz3))=z1eimz1(z1z0)2(z1z2)2(z1z3)2(2+imz12z1(1z1z0+1z1z2+1z1z3)). \begin{aligned} r_1 &= \lim_{z\rightarrow z_1} \dfrac{d}{dz} \left((z-z_1)^2 \dfrac{z^2e^{imz}}{(z^4+a^4)^2}\right) \\ &= \lim_{z\rightarrow z_1} \dfrac{d}{dz} \left(\dfrac{z^2 e^{imz}}{(z-z_0)^2(z-z_2)^2(z-z_3)^2}\right) \\ &= \lim_{z\rightarrow z_1} \dfrac{2ze^{imz}}{(z-z_0)^2(z-z_2)^2(z-z_3)^2} + \dfrac{imz^2 e^{imz}}{(z-z_0)^2(z-z_2)^2(z-z_3)^2} - \dfrac{2z^2e^{imz}}{(z-z_0)^2(z-z_2)^2(z-z_3)^2} \\\left(\dfrac{1}{z-z_0}+\dfrac{1}{z-z_2}+\dfrac{1}{z-z_3}\right) \\ &= \lim_{z\rightarrow z_1} \dfrac{ze^{imz}}{(z-z_0)^2(z-z_2)^2(z-z_3)^2} \left(2+imz-2z\left(\dfrac{1}{z-z_0}+\dfrac{1}{z-z_2}+\dfrac{1}{z-z_3}\right)\right) \\ &= \dfrac{z_1 e^{imz_1}}{(z_1-z_0)^2(z_1-z_2)^2(z_1-z_3)^2} \left(2 + imz_1 - 2z_1 \left(\dfrac{1}{z_1-z_0}+\dfrac{1}{z_1-z_2}+\dfrac{1}{z_1-z_3}\right)\right). \end{aligned}

First, we shall find z1z0z_1-z_0, z1z2z_1-z_2 and z1z3z_1-z_3 as these formulae will simplify the equations we have:

z1z0=(z0z1)=a2.z1z2=a(e3πi4e5πi4)=ae3πi4(1eπi2)=ae3πi4(1i)=ae3πi42eπi4=a2eπi2.z1z3=a(e3πi4e7πi4)=ae3πi4(1eπi)=ae3πi4(1(1))=2ae3πi4.iz1=eπi2ae3πi4=ae5πi4=a2(1i). \begin{aligned} z_1 - z_0 &= -(z_0-z_1) \\ &= -a\sqrt{2}.\\ z_1 - z_2 &= a \left(e^{\dfrac{3\pi i}{4}}-e^{\dfrac{5\pi i}{4}}\right) \\ &= ae^{\dfrac{3\pi i}{4}}(1-e^{\dfrac{\pi i}{2}}) \\ &= ae^{\dfrac{3\pi i}{4}}(1-i) \\ &= ae^{\dfrac{3\pi i}{4}} \cdot \sqrt{2} e^{-\dfrac{\pi i}{4}} \\ &= a\sqrt{2} e^{\dfrac{\pi i}{2}}.\\ z_1 - z_3 &= a \left(e^{\dfrac{3\pi i}{4}}-e^{\dfrac{7\pi i}{4}}\right) \\ &= ae^{\dfrac{3\pi i}{4}} (1-e^{\pi i}) \\ &= ae^{\dfrac{3\pi i}{4}} (1 - (-1)) \\ &= 2a e^{\dfrac{3\pi i}{4}}. \\ iz_1 &= e^{\dfrac{\pi i}{2}} ae^{\dfrac{3\pi i}{4}} \\ &= ae^{\dfrac{5\pi i}{4}} \\ &= \dfrac{a}{\sqrt{2}} (-1-i). \end{aligned} r1=ae3πi4eam2(1i)2a22a2eπi4a2e3πi2(2+am2(1i)2ae3πi4(1a2+1a2eπi2+12ae3πi4))=e7πi4eam2(1i)16a5(2am2(1+i)+2e3πi42eπi41) \begin{aligned} r_1 &= \dfrac{ae^{\dfrac{3\pi i}{4}}e^{\dfrac{am}{\sqrt{2}}(-1-i)}}{2a^2 \cdot 2a^2 e^{\pi i} \cdot 4a^2 e^{\dfrac{3\pi i}{2}}} \left(2 + \dfrac{am}{\sqrt{2}}(-1-i)-2ae^{\dfrac{3\pi i}{4}}\left(-\dfrac{1}{a\sqrt{2}}+\dfrac{1}{a\sqrt{2}e^{\dfrac{\pi i}{2}}}+\dfrac{1}{2ae^{\dfrac{3\pi i}{4}}}\right)\right) \\ &= \dfrac{e^{-\dfrac{7\pi i}{4}e^{\frac{am}{\sqrt{2}}(-1-i)}}}{16a^5} (2-\dfrac{am}{\sqrt{2}}(1+i)+\sqrt{2}e^{\dfrac{3\pi i}{4}} - \sqrt{2} e^{\dfrac{\pi i}{4}}-1) \end{aligned}

To simplify the above expression, let us do some complex arithmetic:

2e3πi42eπi4=212(1+i1i)=2.e7πi4=eπi4=12(1+i). \begin{aligned} \sqrt{2} e^{\dfrac{3\pi i}{4}} - \sqrt{2}e^{\dfrac{\pi i}{4}} &= \sqrt{2} \cdot \dfrac{1}{\sqrt{2}} (-1+i - 1 - i) \\ &= -2.\\ e^{-\dfrac{7\pi i}{4}} &= e^{\dfrac{\pi i}{4}} \\ &= \dfrac{1}{\sqrt{2}}(1+i). \end{aligned} r1=eam2(1i)(1+i)16a52(am2(1+i)1)=eam2(1i)16a52(am2i1i)=eam2(1i)16a52(i(1+am2)1) \begin{aligned} r_1 &= \dfrac{e^{\dfrac{am}{\sqrt{2}}(-1-i)}(1+i)}{16a^5 \sqrt{2}}\left(-\dfrac{am}{\sqrt{2}}(1+i)-1\right) \\ &= \dfrac{e^{\dfrac{am}{\sqrt{2}}(-1-i)}}{16a^5 \sqrt{2}}\left(-am\sqrt{2}i - 1 - i\right) \\ &= \dfrac{e^{\dfrac{am}{\sqrt{2}}(-1-i)}}{16a^5 \sqrt{2}}\left(-i(1+am\sqrt{2})-1\right) \end{aligned}

The sum of the residues is thus:

residues=eam2(1+i)16a52(i(am2+1)+1)+eam2(1i)16a52(i(1+am2)1)=eam216a52(eami2eami2i(am2+1)(eami2+eami2))=eam216a52(2isinam22i(am2+1)cosam2)=eam2i8a52(sinam2(am2+1)cosam2) \begin{aligned} \sum \mathrm{residues} &= \dfrac{e^{\dfrac{am}{\sqrt{2}}(-1+i)}}{16a^5\sqrt{2}}\left(-i\left(am\sqrt{2}+1\right)+1\right) + \dfrac{e^{\dfrac{am}{\sqrt{2}}(-1-i)}}{16a^5 \sqrt{2}}\left(-i(1+am\sqrt{2})-1\right)\\ &= \dfrac{e^{-\dfrac{am}{\sqrt{2}}}}{16a^5\sqrt{2}} \left(e^{\dfrac{ami}{\sqrt{2}}}-e^{-\dfrac{ami}{\sqrt{2}}} -i (am\sqrt{2}+1)\left(e^{\dfrac{ami}{\sqrt{2}}}+e^{-\dfrac{ami}{\sqrt{2}}}\right)\right) \\ &= \dfrac{e^{-\dfrac{am}{\sqrt{2}}}}{16a^5\sqrt{2}} \left(2i\sin{\dfrac{am}{\sqrt{2}}} -2i (am\sqrt{2}+1)\cos{\dfrac{am}{\sqrt{2}}}\right) \\ &= \dfrac{e^{-\dfrac{am}{\sqrt{2}}}i}{8a^5\sqrt{2}}\left(\sin{\dfrac{am}{\sqrt{2}}} -(am\sqrt{2}+1)\cos{\dfrac{am}{\sqrt{2}}}\right) \\ \end{aligned}

Therefore our contour integral equals:

Cz2eimz(z4+a4)2dz=2πiresidues=eam2π4a52((am2+1)cosam2sinam2).(1) \begin{aligned} \oint_C \dfrac{z^2 e^{imz}}{(z^4+a^4)^2} dz &= 2 \pi i \sum \mathrm{residues} \\ &= \dfrac{e^{-\dfrac{am}{\sqrt{2}}}\pi}{4a^5\sqrt{2}}\left((am\sqrt{2}+1)\cos{\dfrac{am}{\sqrt{2}}}-\sin{\dfrac{am}{\sqrt{2}}}\right).\hspace{5cm}\tag{1} \end{aligned}

Evaluating integral components

Breaking our contour integral into its components:

Cz2eimz(z4+a4)2dz=ABz2eimz(z4+a4)2dz+BAz2eimz(z4+a4)2dz \begin{aligned} \oint_C \dfrac{z^2 e^{imz}}{(z^4+a^4)^2} dz &= \int_{AB} \dfrac{z^2 e^{imz}}{(z^4+a^4)^2} dz + \int_{BA} \dfrac{z^2 e^{imz}}{(z^4+a^4)^2} dz \end{aligned}

Along AB: z=xz=x, dz=dxdz=dx and xx goes from R-R to RR. Along BA: z=Reiθz=Re^{i\theta}, dz=iReiθdθdz=iRe^{i\theta}d\theta and θ\theta goes from 00 to π\pi.

ABz2eimz(z4+a4)2dz+BAz2eimz(z4+a4)2dz=RRx2eimx(x4+a4)2dx+0πR2e2iθeimReiθ(R4e4iθ+a4)2iReiθdθ=RRx2eimx(x4+a4)2dx+i0πR3e3iθeimReiθ(R4e4iθ+a4)2dθ. \begin{aligned} \int_{AB} \dfrac{z^2 e^{imz}}{(z^4+a^4)^2} dz + \int_{BA} \dfrac{z^2 e^{imz}}{(z^4+a^4)^2} dz &= \int_{-R}^R \dfrac{x^2 e^{imx}}{(x^4+a^4)^2} dx + \int_{0}^{\pi} \dfrac{R^2 e^{2i\theta} e^{imRe^{i\theta}}}{(R^4e^{4i\theta}+a^4)^2} iRe^{i\theta} d\theta \\ &= \int_{-R}^R \dfrac{x^2 e^{imx}}{(x^4+a^4)^2} dx + i\int_{0}^{\pi} \dfrac{R^3 e^{3i\theta} e^{imRe^{i\theta}}}{(R^4e^{4i\theta}+a^4)^2} d\theta. \\ \end{aligned}

Taking the limit as RR\rightarrow\infty:

limRRRx2eimx(x4+a4)2dx+i0πR3e3iθeimReiθ(R4e4iθ+a4)2dθ=x2eimx(x4+a4)2dx+limRi0πR3e3iθeimReiθ(R4e4iθ+a4)2dθ=x2eimx(x4+a4)2dx+limRi0πR3e3iθeimReiθR8e8iθ+a8+2a4R4e4iθdθ=x2eimx(x4+a4)2dx+limRi0πeimReiθR5e5iθ+a8e3iθR3+2a4Reiθdθ=x2eimx(x4+a4)2dx+limRi0πeimRcosθmRsinθR5e5iθ+a8e3iθR3+2a4Reiθdθ=x2eimx(x4+a4)2dx+limRi0πeimRcosθemRsinθR5e5iθ+a8e3iθR3+2a4Reiθdθ \begin{aligned} \lim_{R\rightarrow \infty} \int_{-R}^R \dfrac{x^2 e^{imx}}{(x^4+a^4)^2} dx + i\int_{0}^{\pi} \dfrac{R^3 e^{3i\theta} e^{imRe^{i\theta}}}{(R^4e^{4i\theta}+a^4)^2} d\theta &= \int_{-\infty}^{\infty} \dfrac{x^2 e^{imx}}{(x^4+a^4)^2} dx + \lim_{R\rightarrow \infty} i\int_{0}^{\pi} \dfrac{R^3 e^{3i\theta} e^{imRe^{i\theta}}}{(R^4e^{4i\theta}+a^4)^2} d\theta \\ &= \int_{-\infty}^{\infty} \dfrac{x^2 e^{imx}}{(x^4+a^4)^2} dx + \lim_{R\rightarrow \infty} i\int_{0}^{\pi} \dfrac{R^3 e^{3i\theta} e^{imRe^{i\theta}}}{R^8e^{8i\theta}+a^8+2a^4R^4e^{4i\theta}} d\theta \\ &= \int_{-\infty}^{\infty} \dfrac{x^2 e^{imx}}{(x^4+a^4)^2} dx + \lim_{R\rightarrow \infty} i\int_{0}^{\pi} \dfrac{e^{imRe^{i\theta}}}{R^5e^{5i\theta}+a^8e^{-3i\theta}R^{-3}+2a^4Re^{i\theta}} d\theta \\ &= \int_{-\infty}^{\infty} \dfrac{x^2 e^{imx}}{(x^4+a^4)^2} dx + \lim_{R\rightarrow \infty} i\int_{0}^{\pi} \dfrac{e^{imR\cos{\theta}-mR\sin{\theta}}}{R^5e^{5i\theta}+a^8e^{-3i\theta}R^{-3}+2a^4Re^{i\theta}} d\theta \\ &= \int_{-\infty}^{\infty} \dfrac{x^2 e^{imx}}{(x^4+a^4)^2} dx + \lim_{R\rightarrow \infty} i\int_{0}^{\pi} \dfrac{e^{imR\cos{\theta}}e^{-mR\sin{\theta}}}{R^5e^{5i\theta}+a^8e^{-3i\theta}R^{-3}+2a^4Re^{i\theta}} d\theta \end{aligned}

Within the domain of integration for the second integral, sinθ0\sin{\theta} \geq 0 and therefore emRsinθ1e^{-mR\sin{\theta}} \leq 1 (assuming m0m\geq0). As the denominator contains some positive powers of RR, as RR\rightarrow\infty the denominator goes to infinity and therefore the integrand goes to zero. The integral of 0 is 0 and therefore our second integral becomes zero.

Conclusion

Therefore our contour integral becomes:

x2eimx(x4+a4)2dx=x2(cosmx+isinmx)(x4+a4)2dx=x2cosmx(x4+a4)2dx+ix2sinmx(x4+a4)2dx \begin{aligned} \int_{-\infty}^{\infty} \dfrac{x^2 e^{imx}}{(x^4+a^4)^2} dx &= \int_{-\infty}^{\infty} \dfrac{x^2 (\cos{mx}+i\sin{mx})}{(x^4+a^4)^2} dx \\ &= \int_{-\infty}^{\infty} \dfrac{x^2 \cos{mx}}{(x^4+a^4)^2} dx + i \int_{-\infty}^{\infty} \dfrac{x^2 \sin{mx}}{(x^4+a^4)^2} dx \end{aligned}

Equating with the right-hand side of (1):

x2cosmx(x4+a4)2dx+ix2sinmx(x4+a4)2dx=eam2π4a52((am2+1)cosam2sinam2) \begin{aligned} \int_{-\infty}^{\infty} \dfrac{x^2 \cos{mx}}{(x^4+a^4)^2} dx + i \int_{-\infty}^{\infty} \dfrac{x^2 \sin{mx}}{(x^4+a^4)^2} dx &= \dfrac{e^{-\dfrac{am}{\sqrt{2}}}\pi}{4a^5\sqrt{2}}\left((am\sqrt{2}+1)\cos{\dfrac{am}{\sqrt{2}}}-\sin{\dfrac{am}{\sqrt{2}}}\right) \end{aligned}

Equating real and imaginary parts:

x2cosmx(x4+a4)2dx=eam2π4a52((am2+1)cosam2sinam2)x2sinmx(x4+a4)2dx=0. \begin{aligned} \int_{-\infty}^{\infty} \dfrac{x^2 \cos{mx}}{(x^4+a^4)^2} dx &= \dfrac{e^{-\dfrac{am}{\sqrt{2}}}\pi}{4a^5\sqrt{2}}\left((am\sqrt{2}+1)\cos{\dfrac{am}{\sqrt{2}}}-\sin{\dfrac{am}{\sqrt{2}}}\right) \\ \int_{-\infty}^{\infty} \dfrac{x^2 \sin{mx}}{(x^4+a^4)^2} dx &= 0. \end{aligned}

It is important to note, however, that because cos(mx)=cosmx\cos{(-mx)}=\cos{mx} and (a)4=a4(-a)^4=a^4, the sign of aa and mm should not matter, therefore provided aa and mm are real:

x2cosmx(x4+a4)2dx=eam2π4a52((am2+1)cosam2sinam2) \int_{-\infty}^{\infty} \dfrac{x^2 \cos{mx}}{(x^4+a^4)^2} dx = \dfrac{e^{-\dfrac{|am|}{\sqrt{2}}}\pi}{4|a|^5\sqrt{2}}\left((|am|\sqrt{2}+1)\cos{\dfrac{am}{\sqrt{2}}}-\sin{\dfrac{|am|}{\sqrt{2}}}\right)