Using series expansion evaluate the integral I=\int _{0}^{1}\ln \left ( \frac{1+x}{1-x}\right ) \frac{dx}{x}
Solution
We first need to find the Taylor series for \ln \left ( \frac{1+x}{1-x}\right ) expanded around x=0. Since \begin{align} \ln \left ( \frac{1+x}{1-x}\right ) & =\ln \left ( \left ( 1+x\right ) \left ( \frac{1}{1-x}\right ) \right ) \nonumber \\ & =\ln \left ( 1+x\right ) +\ln \left ( \frac{1}{1-x}\right ) \nonumber \\ & =\ln \left ( 1+x\right ) -\ln \left ( 1-x\right ) \tag{1} \end{align}
Looking at \ln \left ( 1+x\right ) , where now f\left ( x\right ) =\ln \left ( 1+x\right ) , then we see that f^{\prime }\left ( x\right ) =\frac{1}{1+x},f^{\prime \prime }\left ( x\right ) =\frac{-1}{\left ( 1+x\right ) ^{2}},f^{\prime \prime \prime }\left ( x\right ) =\frac{2}{\left ( 1+x\right ) ^{3}},f^{\left ( 4\right ) }\left ( x\right ) =-\frac{2\cdot 3}{\left ( 1+x\right ) ^{4}},\cdots , therefore\begin{align} \ln \left ( 1+x\right ) & =f\left ( 0\right ) +xf^{\prime }\left ( 0\right ) +\frac{x^{2}}{2}f^{\prime \prime }\left ( 0\right ) +\frac{x^{3}}{3!}f^{\prime \prime \prime }\left ( 0\right ) +\frac{x^{4}}{4!}f^{\left ( 4\right ) }\left ( 0\right ) +\cdots \nonumber \\ & =0+x-\frac{x^{2}}{2}+\frac{x^{3}}{3}-\frac{x^{4}}{4}+\cdots \tag{2} \end{align}
Similarly for \ln \left ( 1-x\right ) , where now f^{\prime }\left ( x\right ) =\frac{-1}{1-x},f^{\prime \prime }\left ( x\right ) =\frac{-1}{\left ( 1-x\right ) ^{2}},f^{\prime \prime \prime }\left ( x\right ) =\frac{-2}{\left ( 1-x\right ) ^{3}},f^{\left ( 4\right ) }\left ( x\right ) =-\frac{2\cdot 3}{\left ( 1-x\right ) ^{4}},\cdots , therefore\begin{align} \ln \left ( 1-x\right ) & =f\left ( 0\right ) +xf^{\prime }\left ( 0\right ) +\frac{x^{2}}{2}f^{\prime \prime }\left ( 0\right ) +\frac{x^{3}}{3!}f^{\prime \prime \prime }\left ( 0\right ) +\frac{x^{4}}{4!}f^{\left ( 4\right ) }\left ( 0\right ) +\cdots \nonumber \\ & =0-x-\frac{x^{2}}{2}-\frac{x^{3}}{3}-\frac{x^{4}}{4}+\cdots \tag{3} \end{align}
Using (2,3) in (1) gives the series expansion for \ln \left ( \frac{1+x}{1-x}\right ) as\begin{align} \ln \left ( \frac{1+x}{1-x}\right ) & =\left ( x-\frac{x^{2}}{2}+\frac{x^{3}}{3}-\frac{x^{4}}{4}+\cdots \right ) -\left ( -x-\frac{x^{2}}{2}-\frac{x^{3}}{3}-\frac{x^{4}}{4}+\cdots \right ) \nonumber \\ & =2x+\frac{2}{3}x^{3}+\frac{2}{5}x^{5}+\frac{2}{7}x^{7}+\cdots \tag{4} \end{align}
Using (4) in the integral given results in \begin{align*} I & =\int _{0}^{1}\left ( 2x+\frac{2}{3}x^{3}+\frac{2}{5}x^{5}+\frac{2}{7}x^{7}+\cdots \right ) \frac{dx}{x}\\ & =\int _{0}^{1}\left ( 2+\frac{2}{3}x^{2}+\frac{2}{5}x^{4}+\frac{2}{7}x^{6}+\cdots \right ) dx\\ & =\left [ 2x+\frac{2}{3}\frac{x^{3}}{3}+\frac{2}{5}\frac{x^{5}}{5}+\frac{2}{7}\frac{x^{7}}{7}+\cdots \right ] _{0}^{1} \end{align*}
Which simplifies to \begin{align} I & =2+\frac{2}{3}\frac{1}{3}+\frac{2}{5}\frac{1}{5}+\frac{2}{7}\frac{1}{7}+\cdots \nonumber \\ & =2+\frac{2}{3^{2}}+\frac{2}{5^{2}}+\frac{2}{7^{2}}+\frac{2}{9^{2}}+\cdots \nonumber \\ & =2\left ( 1+\frac{1}{3^{2}}+\frac{1}{5^{2}}+\frac{1}{7^{2}}+\frac{1}{9^{2}}+\cdots \right ) \nonumber \\ & =2\sum _{n=0}^{\infty }\frac{1}{\left ( 2n+1\right ) ^{2}} \tag{5} \end{align}
The following are two methods to obtain closed form sum for \sum _{n=0}^{\infty }\frac{1}{\left ( 2n+1\right ) ^{2}}. The first method is based on writing\begin{equation} \sum _{n=1}^{\infty }\frac{1}{n^{2}}=\sum _{n=1}^{\infty }\frac{1}{\left ( 2n\right ) ^{2}}+\sum _{n=0}^{\infty }\frac{1}{\left ( 2n+1\right ) ^{2}} \tag{6} \end{equation}
Another way to obtained closed form sum for \sum _{n=0}^{\infty }\frac{1}{\left ( 2n+1\right ) ^{2}} is to use Fourier series. Considering the Fourier series for the following periodic function f\left ( x\right ) =\left \{ \begin{array} [c]{ccc}-x & & -\pi <x<0\\ 0 & & 0\leq x\leq \pi \end{array} \right .
Hence the Fourier series for f\left ( x\right ) is\begin{align*} f\left ( x\right ) & =\frac{\pi }{4}-\frac{1}{\pi }\sum _{n=1}^{\infty }\frac{1+\left ( -1\right ) ^{n+1}}{n^{2}}\cos \left ( nx\right ) -\frac{1}{\pi }\sum _{n=0}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{n}\pi \left ( \sin nx\right ) \\ & =\frac{\pi }{4}-\frac{1}{\pi }\sum _{n=1}^{\infty }\frac{1+\left ( -1\right ) ^{n+1}}{n^{2}}\cos \left ( nx\right ) -\sum _{n=0}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{n}\sin \left ( nx\right ) \end{align*}
Evaluating the above at x=0 then all the \sin terms vanish and we obtain\begin{align*} 0 & =\frac{\pi }{4}-\frac{1}{\pi }\sum _{n=1}^{\infty }\frac{1+\left ( -1\right ) ^{n+1}}{n^{2}}\\ & =\frac{\pi }{4}-\frac{2}{\pi }\left ( 1+\frac{1}{3^{2}}+\frac{1}{5^{2}}+\frac{1}{7^{2}}+\cdots \right ) \\ & =\frac{\pi }{4}-\frac{2}{\pi }\sum _{n=0}^{\infty }\frac{1}{\left ( 2n+1\right ) ^{2}} \end{align*}
Therefore\begin{align*} \frac{2}{\pi }\sum _{n=0}^{\infty }\frac{1}{\left ( 2n+1\right ) ^{2}} & =\frac{\pi }{4}\\ \sum _{n=0}^{\infty }\frac{1}{\left ( 2n+1\right ) ^{2}} & =\frac{\pi ^{2}}{8} \end{align*}
Now that we found closed form sum for \sum _{n=0}^{\infty }\frac{1}{\left ( 2n+1\right ) ^{2}}, we can find the value of the integral. Since I=2\sum _{n=0}^{\infty }\frac{1}{\left ( 2n+1\right ) ^{2}}, then\begin{align*} \int _{0}^{1}\ln \left ( \frac{1+x}{1-x}\right ) \frac{dx}{x} & =2\left ( \frac{\pi ^{2}}{8}\right ) \\ & =\frac{\pi ^{2}}{4} \end{align*}
Let I\left ( x\right ) =\int _{0}^{\infty }e^{xf\left ( t\right ) }dt with f\left ( t\right ) =t-\frac{e^{t}}{x}, find a large x approximation for this integral.
Solution
\begin{align} I & =\int _{0}^{\infty }\exp \left ( xf\left ( t\right ) \right ) dt\nonumber \\ & =\int _{0}^{\infty }\exp \left ( x\left ( t-\frac{e^{t}}{x}\right ) \right ) dt\nonumber \\ & =\int _{0}^{\infty }\exp \left ( xt-e^{t}\right ) dt\nonumber \\ & =\int _{0}^{\infty }\exp \left ( F\left ( t\right ) \right ) dt \tag{1} \end{align}
Where F\left ( t\right ) =xt-e^{t}. We need to find saddle point where F\left ( t\right ) is maximum. Hence\begin{align*} \frac{d}{dt}F\left ( t\right ) & =0\\ x-e^{t} & =0\\ e^{t} & =x\\ t_{0} & =\ln \left ( x\right ) \end{align*}
Where t_{0} is location of t where F\left ( t\right ) is maximum. We called this in class t_{peak}. We now expand F\left ( t\right ) around t_{0} using Taylor series\begin{equation} F\left ( t\right ) =F\left ( t_{0}\right ) +F^{\prime }\left ( t_{0}\right ) \left ( t-t_{0}\right ) +\frac{1}{2}F^{\prime \prime }\left ( t_{0}\right ) \left ( t-t_{0}\right ) ^{2}+\cdots \tag{2} \end{equation}
And F^{\prime }\left ( t\right ) =x-e^{t}, hence as expected F^{\prime }\left ( t_{0}\right ) =0. And F^{\prime \prime }\left ( t\right ) =-e^{t}, therefore F^{\prime \prime }\left ( t_{0}\right ) =-e^{\ln x}=-x. We see also that F^{\prime \prime }\left ( t_{0}\right ) <0, which means the saddle point was a maximum and not a minimum (since x is positive). Using these in (2) gives\begin{align*} F\left ( t\right ) & \approx \left ( x\ln x-x\right ) +\frac{1}{2}\left ( -x\right ) \left ( t-\ln x\right ) ^{2}\\ & =x\ln x-x-\frac{1}{2}x\left ( t-\ln x\right ) ^{2} \end{align*}
Substituting the above into (1) gives\begin{align} I & =\int _{0}^{\infty }\exp \left ( x\ln x-x-\frac{1}{2}x\left ( t-\ln x\right ) ^{2}\right ) dt\nonumber \\ & =\int _{0}^{\infty }\exp \left ( x\ln x\right ) \exp \left ( -x\right ) \exp \left ( -\frac{1}{2}x\left ( t-\ln x\right ) ^{2}\right ) dt\nonumber \\ & =\exp \left ( x\ln x\right ) \exp \left ( -x\right ) \int _{0}^{\infty }\exp \left ( -\frac{1}{2}x\left ( t-\ln x\right ) ^{2}\right ) dt\nonumber \\ & =x^{x}e^{-x}\int _{0}^{\infty }e^{-\frac{1}{2}x\left ( t-\ln x\right ) ^{2}}dt \tag{3} \end{align}
Now, since the peak value where F\left ( t\right ) occurs is on the positive real axis, because t_{0}=\ln \left ( x\right ) , therefore x>1 to have a maximum, and assuming a narrow peak, then all the contribution to the integral comes from x close to the peak location, so we can change \int _{0}^{\infty }e^{-\frac{1}{2}x\left ( t-\ln x\right ) ^{2}}dt to \int _{-\infty }^{\infty }e^{-\frac{1}{2}x\left ( t-\ln x\right ) ^{2}}dt without affecting the final result. Therefore (3) becomes\begin{equation} I=x^{x}e^{-x}\int _{-\infty }^{\infty }e^{-\frac{1}{2}x\left ( t-\ln x\right ) ^{2}}dt \tag{4} \end{equation}
Evaluate the following integrals with aid of residue theorem a\geq 0. (a) \int _{0}^{\infty }\frac{1}{x^{4}+1}dx (b) \int _{0}^{\infty }\frac{\cos \left ( ax\right ) }{x^{2}+1}dx
Since the integrand is even, then I=\frac{1}{2}\int _{-\infty }^{\infty }\frac{1}{x^{4}+1}dx
Therefore{\displaystyle \oint \limits _{C}} f\left ( z\right ) dz=\left ( \lim _{R\rightarrow \infty }\int _{-R}^{0}f\left ( x\right ) dx+\lim _{\tilde{R}\rightarrow \infty }\int _{0}^{\tilde{R}}f\left ( x\right ) dx\right ) +\lim _{R\rightarrow \infty }\int _{C_{R}}f\left ( z\right ) dz
Where \sum \operatorname{Residue} is sum of residues of \frac{1}{z^{4}+1} for poles that are inside the contour C. Therefore the above becomes\begin{align} \lim _{R\rightarrow \infty }\int _{-R}^{R}f\left ( x\right ) dx & =2\pi i\sum \operatorname{Residue}-\lim _{R\rightarrow \infty }\int _{C_{R}}f\left ( z\right ) dz\nonumber \\ \int _{-\infty }^{\infty }\frac{1}{x^{4}+1}dx & =2\pi i\sum \operatorname{Residue}-\lim _{R\rightarrow \infty }\int _{C_{R}}\frac{1}{z^{4}+1}dz \tag{1} \end{align}
Now we will show that \lim _{R\rightarrow \infty }\int _{C_{R}}\frac{1}{z^{4}+1}dz=0. Since \begin{align} \left \vert \int _{C_{R}}\frac{1}{z^{4}+1}dz\right \vert & \leq ML\nonumber \\ & =\left \vert f\left ( z\right ) \right \vert _{\max }\left ( \pi R\right ) \tag{2} \end{align}
But f\left ( z\right ) =\frac{1}{\left ( z^{2}-i\right ) \left ( z^{2}+i\right ) }
Therefore (2) becomes \left \vert \int _{C_{R}}\frac{1}{z^{4}+1}dz\right \vert \leq \frac{\pi R}{R^{4}-1}
\begin{align*} z_{1} & =e^{i\frac{\pi }{4}}\\ z_{2} & =e^{i\frac{3}{4}\pi }\\ z_{3} & =e^{i\frac{5}{4}\pi }\\ z_{4} & =e^{i\frac{7}{4}\pi } \end{align*}
Out of these only the first two are in upper half plane z_{1} and z_{1}. Hence\begin{align} \operatorname{Residue}\left ( z_{1}\right ) & =\lim _{z\rightarrow z_{1}}\left ( z-z_{1}\right ) f\left ( z\right ) \nonumber \\ & =\lim _{z\rightarrow z_{1}}\left ( z-z_{1}\right ) \frac{1}{z^{4}-1}\nonumber \end{align}
Applying L’Hopitals\begin{align*} \operatorname{Residue}\left ( z_{1}\right ) & =\lim _{z\rightarrow z_{1}}\frac{1}{4z^{3}}\\ & =\frac{1}{4\left ( e^{i\frac{\pi }{4}}\right ) ^{3}}\\ & =\frac{1}{4e^{i\frac{3\pi }{4}}} \end{align*}
Similarly for the other residue\begin{align} \operatorname{Residue}\left ( z_{2}\right ) & =\lim _{z\rightarrow z_{2}}\left ( z-z_{2}\right ) f\left ( z\right ) \nonumber \\ & =\lim _{z\rightarrow z_{1}}\left ( z-z_{2}\right ) \frac{1}{z^{4}-1}\nonumber \end{align}
Applying L’Hopitals\begin{align*} \operatorname{Residue}\left ( z_{2}\right ) & =\lim _{z\rightarrow z_{2}}\frac{1}{4z^{3}}\\ & =\frac{1}{4\left ( e^{i\frac{3}{4}\pi }\right ) ^{3}}\\ & =\frac{1}{4e^{i\frac{9\pi }{4}}}\\ & =\frac{1}{4e^{i\frac{\pi }{4}}} \end{align*}
Hence (2A) becomes \begin{align*} \int _{-\infty }^{\infty }\frac{1}{x^{4}+1}dx & =2\pi i\left ( \frac{1}{4e^{i\frac{3\pi }{4}}}+\frac{1}{4e^{i\frac{\pi }{4}}}\right ) \\ & =2\pi i\left ( \frac{\sqrt{2}}{4i}\right ) \\ & =\frac{1}{2}\sqrt{2}\pi \end{align*}
But \int _{0}^{\infty }\frac{1}{x^{4}+1}dx=\frac{1}{2}\int _{-\infty }^{\infty }\frac{1}{x^{4}+1}dx, therefore \begin{align*} \int _{0}^{\infty }\frac{1}{x^{4}+1}dx & =\frac{\sqrt{2}}{4}\pi \\ & =\frac{2}{4\sqrt{2}}\pi \\ & =\frac{\pi }{2\sqrt{2}} \end{align*}
Since the integrand is even, then I=\frac{1}{2}\int _{-\infty }^{\infty }\frac{\cos \left ( ax\right ) }{x^{2}+1}dx
Then{\displaystyle \oint \limits _{C}} f\left ( z\right ) dz=\left ( \lim _{R\rightarrow \infty }\int _{-R}^{0}f\left ( x\right ) dx+\lim _{\tilde{R}\rightarrow \infty }\int _{0}^{\tilde{R}}f\left ( x\right ) dx\right ) +\lim _{R\rightarrow \infty }\int _{C_{R}}f\left ( z\right ) dz
Where \sum \operatorname{Residue} is sum of residues of \frac{e^{iaz}}{x^{2}+1} for poles that are inside the contour C. Therefore the above becomes\begin{align} \lim _{R\rightarrow \infty }\int _{-R}^{R}f\left ( x\right ) dx & =2\pi i\sum \operatorname{Residue}-\lim _{R\rightarrow \infty }\int _{C_{R}}f\left ( z\right ) dz\nonumber \\ \int _{-\infty }^{\infty }\frac{e^{iax}}{x^{2}+1}dx & =2\pi i\sum \operatorname{Residue}-\lim _{R\rightarrow \infty }\int _{C_{R}}\frac{e^{iaz}}{z^{2}+1}dz \tag{1} \end{align}
Now we will show that \lim _{R\rightarrow \infty }\int _{C_{R}}\frac{e^{iaz}}{z^{2}+1}dz=0. Since \begin{align} \left \vert \int _{C_{R}}\frac{e^{iaz}}{z^{2}+1}dz\right \vert & \leq ML\nonumber \\ & =\left \vert f\left ( z\right ) \right \vert _{\max }\left ( \pi R\right ) \tag{2} \end{align}
But \begin{align*} f\left ( z\right ) & =\frac{e^{iaz}}{\left ( z-i\right ) \left ( z+i\right ) }\\ & =\frac{e^{ia\left ( x+iy\right ) }}{\left ( z-i\right ) \left ( z+i\right ) }\\ & =\frac{e^{iax-ay}}{\left ( z-i\right ) \left ( z+i\right ) }\\ & =\frac{e^{iax}e^{-ay}}{\left ( z-i\right ) \left ( z+i\right ) } \end{align*}
Hence\begin{align*} \left \vert f\left ( z\right ) \right \vert _{\max } & =\frac{\left \vert e^{iaz}\right \vert _{\max }\left \vert e^{-ay}\right \vert _{\max }}{\left \vert z-i\right \vert _{\min }\left \vert z+i\right \vert _{\min }}\\ & =\frac{\left \vert e^{-ay}\right \vert _{\max }}{\left ( R+1\right ) \left ( R-1\right ) }\\ & =\frac{\left \vert e^{-ay}\right \vert _{\max }}{R^{2}-1} \end{align*}
Since a>0 and since in upper half y>0 then \left \vert e^{-ay}\right \vert _{\max }=\left \vert e^{-aR}\right \vert _{\max }=1. Jordan inequality was not needed here, since there is no extra x in the numerator of the integrand in this problem. The above now reduces to \left \vert f\left ( z\right ) \right \vert _{\max }=\frac{1}{R^{2}-1}
Only z_{1} is in upper half plane. Therefore\begin{align*} \operatorname{Residue}\left ( z_{1}\right ) & =\lim _{z\rightarrow z_{1}}\left ( z-z_{1}\right ) f\left ( z\right ) \\ & =\lim _{z\rightarrow z_{1}}\left ( z-z_{1}\right ) \frac{e^{iaz}}{\left ( z-z_{1}\right ) \left ( z-z_{2}\right ) }\\ & =\lim _{z\rightarrow z_{1}}\frac{e^{iaz}}{\left ( z-z_{2}\right ) }\\ & =\frac{e^{ia\left ( i\right ) }}{\left ( i+i\right ) }\\ & =\frac{e^{-a}}{2i} \end{align*}
Since \int _{-\infty }^{\infty }\frac{e^{ax}}{x^{4}+1}dx=2\pi i\sum \operatorname{Residue} then \begin{align*} \int _{-\infty }^{\infty }\frac{e^{iax}}{x^{4}+1}dx & =2\pi i\left ( \frac{e^{-a}}{2i}\right ) \\ & =\pi e^{-a} \end{align*}
Therefore\begin{align*} \int _{0}^{\infty }\frac{e^{iax}}{x^{4}+1}dx & =\frac{1}{2}\int _{-\infty }^{\infty }\frac{e^{ax}}{x^{4}+1}dx\\ & =\frac{\pi }{2}e^{-a} \end{align*}
But real part of the above is \int _{0}^{\infty }\frac{\cos \left ( ax\right ) }{x^{4}+1}dx=\frac{\pi }{2}e^{-a}
Using residues evaluate(a) \int _{0}^{2\pi }\frac{1}{1+a\cos \theta }d\theta for \left \vert a\right \vert <1 (b) \int _{0}^{\pi }\left ( \cos \left ( \theta \right ) \right ) ^{2n}d\theta for n integer.
Using contour which is anti-clockwise over the unit circle
Let z=e^{i\theta }, hence dz=d\theta ie^{i\theta }=d\theta iz. Using \cos \theta =\frac{z+z^{-1}}{2} then the integral can be written in complex domain as\begin{align*}{\displaystyle \oint \limits _{C}} \frac{\frac{1}{iz}dz}{1+a\frac{z+z^{-1}}{2}} & =\frac{2}{i}{\displaystyle \oint \limits _{C}} \frac{\frac{1}{z}dz}{2+a\left ( z+\frac{1}{z}\right ) }\\ & =\frac{2}{i}{\displaystyle \oint \limits _{C}} \frac{dz}{2z+az^{2}+a}\\ & =\frac{2}{ai}{\displaystyle \oint \limits _{C}} \frac{dz}{z^{2}+\frac{2}{a}z+1}\\ & =\frac{2}{ai}{\displaystyle \oint \limits _{C}} \frac{dz}{\left ( z-z_{1}\right ) \left ( z-z_{2}\right ) } \end{align*}
Where z_{1},z_{2} are roots of z^{2}+\frac{2}{a}z+1=0 which are found to be (using the quadratic formula) as\begin{align*} z_{1} & =\frac{-1-\sqrt{1-a^{2}}}{a}\\ z_{2} & =\frac{-1+\sqrt{1-a^{2}}}{a} \end{align*}
Since \left \vert a\right \vert <1 then only z_{2} will be inside the unit disk for all a values. Therefore\begin{align} \frac{2}{ai}{\displaystyle \oint \limits _{C}} \frac{dz}{\left ( z-z_{1}\right ) \left ( z-z_{2}\right ) } & =\left ( \frac{2}{ai}\right ) 2\pi i\operatorname{Residue}\left ( z_{2}\right ) \nonumber \\ & =\frac{4}{a}\pi \operatorname{Residue}\left ( z_{2}\right ) \tag{1} \end{align}
Now we will find the \operatorname{Residue}\left ( z_{2}\right ) where in this case f\left ( z\right ) =\frac{1}{\left ( z-z_{1}\right ) \left ( z-z_{2}\right ) }. Hence \begin{align*} \operatorname{Residue}\left ( z_{2}\right ) & =\lim _{z\rightarrow z_{2}}\left ( z-z_{2}\right ) f\left ( z\right ) \\ & =\lim _{z\rightarrow z_{2}}\left ( z-z_{2}\right ) \frac{1}{\left ( z-z_{1}\right ) \left ( z-z_{2}\right ) }\\ & =\lim _{z\rightarrow z_{2}}\frac{1}{\left ( z-z_{1}\right ) }\\ & =\frac{1}{\left ( \frac{-1+\sqrt{1-a^{2}}}{a}\right ) -\left ( \frac{-1-\sqrt{1-a^{2}}}{a}\right ) }\\ & =\frac{a}{2\sqrt{1-a^{2}}} \end{align*}
Using the above result in (1) gives \begin{align*} \int _{0}^{2\pi }\frac{1}{1+a\cos \theta }d\theta & =\left ( \frac{4}{a}\pi \right ) \frac{a}{2\sqrt{1-a^{2}}}\\ & =\frac{2\pi }{\sqrt{1-a^{2}}}\qquad a\neq 1 \end{align*}
Using Maple, verified that the above result is correct.
Since integrand is even, then \int _{0}^{\pi }\left ( \cos \left ( \theta \right ) \right ) ^{2n}d\theta =\frac{1}{2}\int _{0}^{2\pi }\left ( \cos \left ( \theta \right ) \right ) ^{2n}d\theta . Using same contour as in part (a), and letting z=e^{i\theta }, hence dz=d\theta ie^{i\theta }=d\theta iz and using \cos \theta =\frac{z+z^{-1}}{2} then the integral can be written in complex domain as\begin{align*} \int _{0}^{2\pi }\left ( \cos \left ( \theta \right ) \right ) ^{2n}d\theta & ={\displaystyle \oint \limits _{C}} \left ( \frac{z+\frac{1}{z}}{2}\right ) ^{2n}\frac{dz}{iz}\\ & =\frac{1}{i}{\displaystyle \oint \limits _{C}} \frac{\left ( z+\frac{1}{z}\right ) ^{2n}}{2^{2n}}\frac{dz}{z}\\ & =\frac{1}{4^{n}i}{\displaystyle \oint \limits _{C}} \left ( z+\frac{1}{z}\right ) ^{2n}\frac{dz}{z}\\ & =\frac{1}{4^{n}i}{\displaystyle \oint \limits _{C}} \left ( \frac{z^{2}+1}{z}\right ) ^{2n}\frac{dz}{z}\\ & =\frac{1}{4^{n}i}{\displaystyle \oint \limits _{C}} \frac{\left ( z^{2}+1\right ) ^{2n}}{z^{2n}}\frac{dz}{z}\\ & =\frac{1}{4^{n}i}{\displaystyle \oint \limits _{C}} \frac{\left ( z^{2}+1\right ) ^{2n}}{z^{2n+1}}dz \end{align*}
Considering f\left ( z\right ) =\frac{\left ( z^{2}+1\right ) ^{2n}}{z^{2n+1}}, this has a pole at z=0 of order m=2n+1. Therefore\begin{equation} \frac{1}{4^{n}i}{\displaystyle \oint \limits _{C}} \frac{\left ( z^{2}+1\right ) ^{2n}}{z^{2n+1}}dz=\left ( \frac{1}{4^{n}i}\right ) 2\pi i\operatorname{Residue}\left ( z=0\right ) \tag{1} \end{equation}
Equation (1) becomes \int _{0}^{2\pi }\left ( \cos \left ( \theta \right ) \right ) ^{2n}d\theta =\left ( \frac{1}{4^{n}}\right ) 2\pi \left ( \frac{1}{\left ( 2n\right ) !}\lim _{z\rightarrow 0}\left ( \frac{d^{2n}}{dz^{2n}}\left ( z^{2}+1\right ) ^{2n}\right ) \right )
Will now try to obtained closed form solution. Trying for different n values in order to see the pattern. From few lectures ago, we learned also that \Gamma \left ( n+\frac{1}{2}\right ) =\frac{1\cdot 3\cdot 5\cdot \cdots \cdot \left ( 2n-1\right ) }{2^{n}}\sqrt{\pi }
n | \frac{1}{4^{n}}\frac{\pi }{\left ( 2n\right ) !}\lim _{z\rightarrow 0}\left ( \frac{d^{2n}}{dz^{2n}}\left ( z^{2}+1\right ) ^{2n}\right ) | result of integral | \Gamma \left ( n+\frac{1}{2}\right ) |
1 | \frac{1}{4}\frac{\pi }{2!}\lim _{z\rightarrow 0}\frac{d^{2}}{dz^{2}}\left ( z^{2}+1\right ) ^{2} | \frac{\pi }{2} | \Gamma \left ( 1+\frac{1}{2}\right ) =\frac{\sqrt{\pi }}{2} |
2 | \frac{1}{4^{2}}\frac{\pi }{4!}\lim _{z\rightarrow 0}\frac{d^{4}}{dz^{4}}\left ( z^{2}+1\right ) ^{4} | \frac{3\pi }{8} | \Gamma \left ( 2+\frac{1}{2}\right ) =\frac{3\sqrt{\pi }}{4} |
3 | \frac{1}{4^{3}}\frac{\pi }{6!}\lim _{z\rightarrow 0}\frac{d^{6}}{dz^{6}}\left ( z^{2}+1\right ) ^{6} | \frac{5\pi }{16} | \Gamma \left ( 3+\frac{1}{2}\right ) =\frac{15\sqrt{\pi }}{8} |
4 | \frac{1}{4^{4}}\frac{\pi }{8!}\lim _{z\rightarrow 0}\frac{d^{8}}{dz^{8}}\left ( z^{2}+1\right ) ^{8} | \frac{35\pi }{128} | \Gamma \left ( 4+\frac{1}{2}\right ) =\frac{105\sqrt{\pi }}{16} |
5 | \frac{1}{4^{5}}\frac{\pi }{10!}\lim _{z\rightarrow 0}\frac{d^{10}}{dz^{10}}\left ( z^{2}+1\right ) ^{10} | \frac{63\pi }{256} | \Gamma \left ( 5+\frac{1}{2}\right ) =\frac{945\sqrt{\pi }}{32} |
\vdots | \vdots | \vdots | \vdots |
Based on the above, we see that I=\frac{\sqrt{\pi }\Gamma \left ( n+\frac{1}{2}\right ) }{n!}, which is verified as follows
n | result of integral | \Gamma \left ( n+\frac{1}{2}\right ) | \frac{\sqrt{\pi }\Gamma \left ( n+\frac{1}{2}\right ) }{n!} |
1 | \frac{\pi }{2} | \Gamma \left ( 1+\frac{1}{2}\right ) =\frac{\sqrt{\pi }}{2} | \frac{\sqrt{\pi }\left ( \frac{\sqrt{\pi }}{2}\right ) }{1}=\frac{1}{2}\pi |
2 | \frac{3\pi }{8} | \Gamma \left ( 2+\frac{1}{2}\right ) =\frac{3\sqrt{\pi }}{4} | \frac{\sqrt{\pi }\left ( \frac{3\sqrt{\pi }}{4}\right ) }{2!}=\frac{3}{8}\pi |
3 | \frac{5\pi }{16} | \Gamma \left ( 3+\frac{1}{2}\right ) =\frac{15\sqrt{\pi }}{8} | \frac{\sqrt{\pi }\left ( \frac{15\sqrt{\pi }}{8}\right ) }{3!}=\frac{15\pi }{\left ( 6\right ) \left ( 8\right ) }=\frac{15\pi }{48}=\frac{3}{16}\pi |
4 | \frac{35\pi }{128} | \Gamma \left ( 4+\frac{1}{2}\right ) =\frac{105\sqrt{\pi }}{16} | \frac{\sqrt{\pi }\left ( \frac{105\sqrt{\pi }}{16}\right ) }{4!}=\frac{\sqrt{\pi }\left ( 105\sqrt{\pi }\right ) }{\left ( 24\right ) \left ( 16\right ) }=\frac{105\pi }{384}=\frac{35}{128}\pi |
5 | \frac{63\pi }{256} | \Gamma \left ( 5+\frac{1}{2}\right ) =\frac{945\sqrt{\pi }}{32} | \frac{\sqrt{\pi }\left ( \frac{945\sqrt{\pi }}{32}\right ) }{5!}=\frac{945\pi }{\left ( 120\right ) \left ( 32\right ) }=\frac{945\pi }{3840} =\frac{63}{256}\pi |
\vdots | \vdots | \vdots | \vdots |
Therefore \int _{0}^{\pi }\left ( \cos \left ( \theta \right ) \right ) ^{2n}d\theta =\frac{\sqrt{\pi }\Gamma \left ( n+\frac{1}{2}\right ) }{n!}