# An integral : $\int_{-a}^a \frac{\cos(\pi n x/a)}{x^2+a^2}\mathrm dx$

How can I evaluate $$\int_{-a}^a \frac{\cos(\pi n x/a)}{x^2+a^2}\,\mathrm dx$$?

My attempt :

\begin{align}\mathcal{I}& =\displaystyle\int_{-a}^a \dfrac{\cos(\pi n x/a)}{x^2+a^2}\mathrm dx \\ & = 2\displaystyle\int_0^a \dfrac{\cos(\pi n x/a)}{x^2+a^2}\, \text{ ,even integrand}\\ &=2\displaystyle\int_0^{\pi n} \dfrac{\cos u}{\frac{a^2u^2}{n^2\pi^2}+1}\left(\dfrac{a\mathrm du}{n\pi}\right)\, \text{ ,via substituting u=\dfrac{\pi nx}{a}}\\ &=\dfrac{2\pi n}{a}\displaystyle\int_0^{\pi n} \dfrac{\cos u}{u^2+n^2\pi^2}\, \mathrm du\\ & =\dfrac{2\pi n}{a}\displaystyle\int_0^{n\pi} \dfrac{\cos u}{(u-i\pi n)(u+i\pi n)}\,\mathrm du\\ & =\dfrac{i}{a}\underbrace{\displaystyle\int_0^{n\pi} \dfrac{\cos u}{u+i\pi n}\mathrm du}_{\mathcal{I_1}}-\dfrac{i}{a}\overbrace{\displaystyle\int_0^{n\pi}\dfrac{\cos u}{u-in\pi}\mathrm du}^{\mathcal{I_2}}\, \text{ ,via partial fraction decomposition}\end{align}

\begin{align}\mathcal{I_1}&=\displaystyle\int_0^{n\pi}\dfrac{\cos u}{u+i\pi n}\mathrm du \\&=\displaystyle\int_0^{(i+1)n\pi}\dfrac{\cos(v-i\pi n)}{v}\mathrm dv\, \text{ ,via substituting v=u+i\pi n}\\ & = \displaystyle\sum_{k=0}^\infty \dfrac{(-1)^k}{(2k)!}\displaystyle\int_0^{(i+1)n\pi} \dfrac{(v-i\pi n)^{2k}}{v}\mathrm dv\, \text{ ,via Maclaurin series}\end{align} from where I can't figure out further.

Any help is appreciated.

• Note that you can re-write the original integral in the form $$\frac{2}{a}\int_0^1 {\frac{{\cos (\pi nt)}}{{t^2 + 1}}dt} .$$ According to Wolfram Mathematica, the integral can be written in terms of the Sine and Cosine integrals. I do not know if there is a simpler form.
– Gary
May 10 at 7:09
• May I know the reason for downvote? May 25 at 5:34

## 2 Answers

I do not know if it helps, but... \begin{align} A = \frac{1}{a^2}\int_{-a}^a \frac{\cos(\frac{x}{a}\pi n)}{1+(\frac xa)^2}dx &= \frac{2}{a} \int_0^1 \frac{\cos(\pi n x)}{1+x^2}dx \\ &= \frac{2}{a} \int_0^1 \cos(\pi n x) \sum_{k = 0}^\infty (-x^2)^k dx \\ & = \frac{2}{a} \sum_{k=1}^\infty (-1)^k\int_0^1 x^{2k} \cos (\pi n x)dx \\ &= \frac{2}{a} \sum_{k=1}^\infty (-1)^k I_{2k} \end{align}

For $$I_{2k}$$, we have: \begin{align} I_{2k} &= \int_0^1 x^{2k} \cos(\pi n x) dx \\ &= \frac{1}{\pi n}x^{2k} \sin (\pi n x)\bigg|_0^1 - \frac{2k}{\pi n}\int_0^1 x^{2k-1} \sin(\pi n x) dx \\ &= - \frac{2k}{\pi n} \int_0^1 x^{2k-1}\sin(\pi n x) dx \\ &= -\frac{2k}{\pi n} \left(-\frac{1}{\pi n} x^{2k-1} \cos (\pi n x)\bigg|_0^1 + \frac{2k-1}{\pi n} \int_0^1 x^{2k-2} \cos(\pi n x)dx \right) \\ &= -\frac{2k}{\pi n}\left(\frac{1}{\pi n} + \frac{2k - 1}{\pi n}\int_0^1 x^{2k-2} \cos(\pi n x)dx \right) \\ &= \frac{1}{(\pi n)^2}\left((2k)(2k-1)\int_0^1 x^{2k-2} \cos(\pi n x)dx - 1\right) \end{align}

Therefore,

\begin{align} I_{2k} = \frac{2k(2k-1)}{(\pi n)^2}I_{2k-2} - \frac{1}{(\pi n)^2}\end{align}

• @NikhilKumarSingh I'm not sure why you accepted this answer, though. May 25 at 6:43
• It seemed more helpful out of the two to me. May 26 at 10:18

For $$I=\int\dfrac{\cos( u)}{u+i\pi n}\,du$$ $$u+i\pi n=v \implies I=\int \frac{\cos(v-i\pi n)}v \,dv$$ Expand the cosine $$\cos(v-i\pi n)=\cosh (\pi n) \cos (v)+i \sinh (\pi n) \sin (v)$$ $$I=\cosh (\pi n) \int \frac{\cos(v)}v \,dv+i \sinh (\pi n) \int \frac{\sin(v)}v \,dv$$ $$I=\cosh (\pi n)\,\text{Ci}(v)+i \sinh (\pi n) \,\text{Si}(v)$$