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=∫−∞∞x2cos⁡mx(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 ∫0∞x2cos⁡mx(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πi∑residues2\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,n∈Zzn=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=(z−z0)(z−z1)(z−z2)(z−z3)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 (z−zn)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=lim⁡z→p1(k−1)!dk−1dzk−1((z−p)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=lim⁡z→z01(2−1)!d2−1dz2−1((z−z0)2z2eimz(z4+a4)2)=lim⁡z→z0ddz(z2eimz(z−z1)2(z−z2)2(z−z3)2)=lim⁡z→z02zeimz(z−z1)2(z−z2)2(z−z3)2+imz2eimz(z−z1)2(z−z2)2(z−z3)2−2z2eimz(z−z1)2(z−z2)2(z−z3)2(1z−z1+1z−z2+1z−z3)=lim⁡z→z0zeimz(z−z1)2(z−z2)2(z−z3)2(2+imz−2z(1z−z1+1z−z2+1z−z3))=z0eimz0(z0−z1)2(z0−z2)2(z0−z3)2(2+imz0−2z0(1z0−z1+1z0−z2+1z0−z3)) \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:

z0−z1=a(eπi4−e3πi4)=aeπi4(1−eπi2)=aeπi4(1−i)=aeπi42e−πi4=a2.z0−z2=a(eπi4−e5πi4)=aeπi4(1−eπi)=aeπi4(1−(−1))=2aeπi4.z0−z3=a(eπi4−e7πi4)=aeπi4(1−e3π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πi2⋅aeπ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)2a2⋅4a2eπi2⋅2a2eπi(2+am2(−1+i)−2aeπi4(1a2+12aeπi4+1a2eπi2))=e−5πi4eam2(−1+i)16a5(2+am2(−1+i)−2eπi4−1−2e−π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 e−5π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(am2⋅−2i+1−i)=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=lim⁡z→z1ddz((z−z1)2z2eimz(z4+a4)2)=lim⁡z→z1ddz(z2eimz(z−z0)2(z−z2)2(z−z3)2)=lim⁡z→z12zeimz(z−z0)2(z−z2)2(z−z3)2+imz2eimz(z−z0)2(z−z2)2(z−z3)2−2z2eimz(z−z0)2(z−z2)2(z−z3)2(1z−z0+1z−z2+1z−z3)=lim⁡z→z1zeimz(z−z0)2(z−z2)2(z−z3)2(2+imz−2z(1z−z0+1z−z2+1z−z3))=z1eimz1(z1−z0)2(z1−z2)2(z1−z3)2(2+imz1−2z1(1z1−z0+1z1−z2+1z1−z3)). \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 z1−z0z_1-z_0, z1−z2z_1-z_2 and z1−z3z_1-z_3 as these formulae will simplify the equations we have:

z1−z0=−(z0−z1)=−a2.z1−z2=a(e3πi4−e5πi4)=ae3πi4(1−eπi2)=ae3πi4(1−i)=ae3πi4⋅2e−πi4=a2eπi2.z1−z3=a(e3πi4−e7πi4)=ae3πi4(1−eπi)=ae3πi4(1−(−1))=2ae3πi4.iz1=eπi2ae3πi4=ae5πi4=a2(−1−i). \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(−1−i)2a2⋅2a2eπi⋅4a2e3πi2(2+am2(−1−i)−2ae3πi4(−1a2+1a2eπi2+12ae3πi4))=e−7πi4eam2(−1−i)16a5(2−am2(1+i)+2e3πi4−2eπi4−1) \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πi4−2eπi4=2⋅12(−1+i−1−i)=−2.e−7π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(−1−i)(1+i)16a52(−am2(1+i)−1)=eam2(−1−i)16a52(−am2i−1−i)=eam2(−1−i)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(−1−i)16a52(−i(1+am2)−1)=e−am216a52(eami2−e−ami2−i(am2+1)(eami2+e−ami2))=e−am216a52(2isin⁡am2−2i(am2+1)cos⁡am2)=e−am2i8a52(sin⁡am2−(am2+1)cos⁡am2) \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πi∑residues=e−am2π4a52((am2+1)cos⁡am2−sin⁡am2).(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+i∫0π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 R→∞R\rightarrow\infty:

lim⁡R→∞∫−RRx2eimx(x4+a4)2dx+i∫0πR3e3iθeimReiθ(R4e4iθ+a4)2dθ=∫−∞∞x2eimx(x4+a4)2dx+lim⁡R→∞i∫0πR3e3iθeimReiθ(R4e4iθ+a4)2dθ=∫−∞∞x2eimx(x4+a4)2dx+lim⁡R→∞i∫0πR3e3iθeimReiθR8e8iθ+a8+2a4R4e4iθdθ=∫−∞∞x2eimx(x4+a4)2dx+lim⁡R→∞i∫0πeimReiθR5e5iθ+a8e−3iθR−3+2a4Reiθdθ=∫−∞∞x2eimx(x4+a4)2dx+lim⁡R→∞i∫0πeimRcos⁡θ−mRsin⁡θR5e5iθ+a8e−3iθR−3+2a4Reiθdθ=∫−∞∞x2eimx(x4+a4)2dx+lim⁡R→∞i∫0πeimRcos⁡θe−mRsin⁡θR5e5iθ+a8e−3iθR−3+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 e−mRsin⁡θ≤1e^{-mR\sin{\theta}} \leq 1 (assuming m≥0m\geq0). As the denominator contains some positive powers of RR, as R→∞R\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(cos⁡mx+isin⁡mx)(x4+a4)2dx=∫−∞∞x2cos⁡mx(x4+a4)2dx+i∫−∞∞x2sin⁡mx(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):

∫−∞∞x2cos⁡mx(x4+a4)2dx+i∫−∞∞x2sin⁡mx(x4+a4)2dx=e−am2π4a52((am2+1)cos⁡am2−sin⁡am2) \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:

∫−∞∞x2cos⁡mx(x4+a4)2dx=e−am2π4a52((am2+1)cos⁡am2−sin⁡am2)∫−∞∞x2sin⁡mx(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)=cos⁡mx\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:

∫−∞∞x2cos⁡mx(x4+a4)2dx=e−∣am∣2π4∣a∣52((∣am∣2+1)cos⁡am2−sin⁡∣am∣2) \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)