\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\newcommand{\undb}{\underbrace}
\newcommand{\pl}{\partial}
\parindent=0pt
\begin{document}

{\bf Question}

\begin{description}
\item[(a)]
Let $z=x+iy,\ \log z$ be defined with $-\frac{\pi}{2}<\arg
z<\frac{3\pi}{2}$, and set $C$ to be the positively oriented
contour shown in the diagram below.

PICTURE \vspace{2in}

Show that

$$J=\ds\oint_Cdz\ \ds\frac{\log(z+i)}{z^2+1}=\pi\log
2+i\ds\frac{\pi^2}{2}.$$

You should carefully show in the diagram where any branch cuts in
the integrand are located.

\item[(b)]
By considering $J$ and the relationship between the contributions
from $-R \leq x \leq 0$ and $0 \leq x \leq R$, and other factors
show that

$$\ds\int_0^{\infty}dx\ \ds\frac{\log(x^2+1)}{x^2+1}=\pi \log 2.$$

You may assume that $R\ds\frac{|\log(Re^{i\theta}+i)|}{|R^2-1|}
\to 0$ as $R \to \infty,$

$0 \leq \theta \leq \pi$.
\end{description}

\medskip

{\bf Answer}

$$I=\ds\oint_C dz\ \ds\frac{\log(z+i)}{z^2+1}$$

\begin{description}
\item[(a)]
$\ds\oint_C=2\pi i \times
residue\left(\ds\frac{\log(z+i)}{z^2+1}\right)$ at $z=+i$

PICTURE \vspace{2in}

\begin{eqnarray*} 2\pi i \lim_{z \to
i}\left[\ds\frac{\log(z+i)}{(z+i)(z-i)} \times (z-i)\right]\\ & =
& 2\pi i \ds\frac{\log(2i)}{2i}\\ & = & \pi[\log|2i|+i\arg(2i)]\\
& = & \pi \log 2+i\pi \times \ds\frac{\pi}{2}\\ & &  \rm{since}\
-\ds\frac{\pi}{2}<\arg z<\ds\frac{3\pi}{2}\\ & = & \un{\pi \log
2+\ds\frac{i\pi^2}{2}} \end{eqnarray*}

\item[(b)]
$\ds\oint_C=\ds\int_0^R+\ds\int_{z=|R|\ Im(z)>0}+\ds\int_{-R}^0$

Now $\ds\int_0^R=\ds\int_0^R\ds\frac{dx\ \log(x+i)}{(x^2+1)}$

and $\ds\int_{-R}^0=-\ds\int_R^0\ds\frac{dx\
\log(-x+i)}{(-x)^2+1}=\ds\int_0^R \ds\frac{dx\ \log(i-x)}{x^2+1}$

$z=-x$

\begin{eqnarray*} \ds\int_{z=|R|\ Im(z)>0} & = &
i\ds\int_{\theta=0}{\pi} d\theta\
\ds\frac{e^{i\theta}R\log(Re^{i\theta}+i)}{(R^2e^{2i\theta}+1)}\\
& \leq & \left|\ds\int_0^{\pi}d\theta\
\ds\frac{R\log(Re^{i\theta}+i)}{(R^2e^{2i\theta}+1)}\right|\\ &
\leq & \ds\int_0^{\pi}d\theta\ R\
\ds\frac{|\log(Re^{i\theta}+i)}{|R^2e^{2i\theta}+1|}\\ & \leq &
\ds\int_0^{\theta} d\theta\
\ds\frac{R|\log(Re^{i\theta}+i)|}{|R^2-1|}\\ & & \rm{since}\
|R^2e^{2i\theta}+1| \geq ||R^2 e^{2i\theta}|-|1||=|R^2-1|\\ & \leq
& \ds\frac{\pi R|\log(R e^{i\theta}+i)|}{|R^2-1|}\\ & \to & 0\
\rm{as}\ R \to \infty\ \rm{by\ hint} \end{eqnarray*}

Therefore $J=\lim_{R\to\infty}\ds\int_0^R dx\
\ds\frac{\log(x+i)}{x^2+1}+\lim_{R\to\infty}\ds\int_0^Rdx\
\ds\frac{\log(i-x)}{x^2+1}$

Therefore

\begin{eqnarray*} J & = &
\ds\int_0^{\infty}\ds\frac{dx}{(x^2+1)}[\log(x+i)+\log(i-x)]\\ & =
& \ds\int_0^{\infty}\ds\frac{dx}{x^2+1}\log(ix-x^2-1-ix)\\ & = &
\ds\int_0^{\infty}\ds\frac{dx}{(x^2+1)}\log(-x^2-1)\\ & = &
\ds\int_0^{\infty}\ds\frac{dx}{(x^2+1)}\log[(1+x^2)\times -1]\\ &
= &
\ds\int_0^{\infty}\ds\frac{dx}{(x^2+1)}\log(1+x^2)+i\pi\ds\int_0^{\infty}\ds\frac{dx}{(x^2+1)}
\end{eqnarray*}

So

\un{$\ds\int_0^{\infty}\ds\frac{dx}{(x^2+1)}\log(1+x^2)=Re(J)=\pi\log
2$}
\end{description}
\end{document}
