I'm asked to find:  $$\int_{-\infty}^\infty \frac{\ln(x^2+1)}{1+x^2} dx $$  Attempt  Considering $$ \oint \frac{\ln(z^2+1)}{(z+i)(z-i)} dz $$  So first I find the branch points of the function.  This function has a simple pole at $z=i$ and an essential singularity at $z=-i$.  Using this contour:    By residue theorem,  $$\int_\gamma +  \int_AB + \int_BC = 2\pi i \times \text{Residue} $$   $$ \text{Residue} =  \frac{\ln(2i)}{2i} = \frac{\pi}{4} - \frac{i}{2}\ln(2) $$   Taking the semi-circle to infinity, $\int_\gamma \rightarrow 0$ by Jordan's Lemma.  $$\int_{-\infty}^0 \frac{\ln(-|x| + i)}{1+x^2} dx + \int_0^{\infty} \frac{\ln(x+i)}{1+x^2} dx      =   2\pi i \left[ \frac{\pi}{4} - \frac{i}{2}\ln(2) \right]   $$  $$ \int_{-\infty}^0  \frac{\ln (i - |x|) + i\pi}{1+x^2} dx + \int_0^{\infty} \frac{\ln(x+i)}{1+x^2} dx = 2\pi i \left[ \frac{\pi}{4} - \frac{i}{2}\ln(2) \right]  $$  $$  \int_{\infty}^0  \frac{\ln (i - x) + i\pi}{1+x^2} dx + \int_0^{\infty} \frac{\ln(x+i)}{1+x^2} dx = 2\pi i \left[ \frac{\pi}{4} - \frac{i}{2}\ln(2) \right]  $$  I have a hunch that the first integral must become $+\int_0^{\infty}$ for it to combine with the second integral to give $\int_0^\infty \frac{\ln(1+x^2)}{1+x^2}\,dx$ then we take the real part on the right. But I can't seem to show this..
34590
How would I go about evaluating this integral? $$\int_0^{\infty}\frac{\ln(x^2+1)}{x^2+1}dx.$$ What I've tried so far: I tried a semicircular integral in the positive imaginary part of the complex plane, excluding the negative real axis, but had trouble calculating the residue at $z=i$ (perhaps there is a way of doing this that I don't know of). After that didn't work, I tried a rectangular box integral from $\epsilon$ to $R$, from $R$ to $R+i/2$, from $R+i/2$ to $-S+i/2$, from $-S+i/2$ to $-S+i\epsilon$, from $-S+i\epsilon$ to $-\epsilon+i\epsilon$ and finally a semicircle around the origin, radius $\epsilon$.   Any help would be appreciated.
114813
I came across  and even though it was not my own question it intrigued me so much that I tried to solve it:     Using the Residue Theorem find       $$\int_0^\infty \frac{x \sin(x)}{x^2+a^2} dx$$   But I got stuck and questions came up. Here are my thoughts:  First, I think the idea of applying the residue theorem would be to define a curve that is the boundary of one half of a disk centered at the origin. Then one computes the integral of $f$ around this half disk using the residue theorem. Finally, one uses this result by taking the limit of the radius towards infinity to find the integral in the question.     Do I understand the idea of how to approach this problem correctly?   Here is how I tried to implement this:  First, we note that the poles are at $\pm ia$. So we want to choose the radius of the disk bigger than $a$. For example, $2a$ should do.   Then the curves that together form the contour (CCW) are:  $$ \gamma_1(t) = -2a + 2at, t \in [0,1]$$ and $$ \gamma_2(t) = 2a e^{it}, t \in [0,\pi]$$  Then   $$ \oint_C f(z) dz = 2 \pi i \text{Res}_f (ia) = 2 \pi i \lim_{z \to ia} (z - ia) \frac{z \sin(z)}{z^2+a^2} = 2 \pi i \lim_{z \to ia}  \frac{z \sin(z)}{(z+ia)} =  \pi i { \sin(ia) }$$  Then  $$\begin{align}  \int_{-2a}^{2a}f(z) dz &amp;=  \oint_C f(z) dz - \oint_{\gamma_2} f(z) dz  \\ &amp;=  \pi i { \sin(ia) } - \int_0^\pi {\gamma_2(t) \sin (\gamma_2(t)) \over \gamma_2^2(t) + a^2} 2ai e^{it} dt\\ &amp;=\pi i { \sin(ia) } - \int_0^\pi {2a e^{it} \sin (2a e^{it}) \over 4a^2 e^{2it} + a^2} 2ai e^{it} dt\\ &amp;=\pi i { \sin(ia) } - \int_0^\pi {2a e^{it} \sin (2a e^{it}) \over (2a e^{it} + ia)(2ae^{it} - ia)} 2ai e^{it} dt \end{align}$$  And this is where I got stuck. I can't calculate $ \int_0^\pi {2a e^{it} \sin (2a e^{it}) \over (2a e^{it} + ia)(2ae^{it} - ia)} 2ai e^{it} dt$. This integral seems impossible to solve.     Did I make a mistake in the approach? Or did I miscalculate somewhere?   Or is there a trick to solve integrals like this one?
11415
Prove the following using complex analysis   $$\tag{1}\int^\infty_0\frac{\ln(1+x)}{1+x^2}\,dx=\frac{\pi}{2}\ln(2)$$  I found this problem in Schaum's outlines of complex variables.   I thought that we could solve the problem using a similar method to evaluating   $$\int^\infty_0\frac{\ln(1+x^2)}{1+x^2}\,dx$$   Where we integrate the function  $$f=\frac{\log(1-iz)}{z^2+1}$$  around half a circle in the upper half plane and chosing an analytic branch of the logarithm in the region.   I spent so much time on (1) without success.
66782
I'm trying to find $$ \lim_{n \to \infty}   \int_1^a \dfrac{n}{1+x^n} \, dx  ,$$ where parameter $a&gt;1$. The limit appears to be $\ln 2$ regardless of the value of $a$. Some trick is probably needed here, but i don't see it.
13028
As usual, I have a ridiculously specific question about a tiny detail of a tiny calculation. There is a tremendous amount of context, so fair warning. I don't need a solution to this whole problem. I need a solution to one specific part, and it is a minor detail. I'll show what I've got so far, and point out my concern at the end.  Our problem is to use residue calculus to compute: $$\int\limits_{-\infty}^{\infty}\frac{\cos(2x)-1}{x^2}dx.$$  We note that this is equal to the real part of the easier-to-work-with integral: $$\int\limits_{-\infty}^{\infty}\frac{e^{2ix}-1}{x^2}dx,$$ and we use a "hippo's back" contour, formed by the positively-oriented half-circle $|z|\leq R$ in the upper half-plane and the line along the real axis from $-R$ to $R$, interrupted from $-\varepsilon$ to $\varepsilon$ by the negatively oriented half-circle in the upper half-plane of radius $\varepsilon$, so as to 'jump' over the simple pole at $z=0$.  Since this contour contains no poles or singularities, etc., the integral of our integrand around it is zero by Cauchy's Theorem. It is also a simple matter to show that the large half-circle's contribution is zero in the limit $R\to\infty$. So now we are left with the fact that in the limit $\varepsilon\to 0$, we obtain:  $$\int\limits_{-\infty}^{\infty}\frac{e^{2ix}-1}{x^2}dx=\lim\limits_{\varepsilon\to 0}\int\limits_{C_\varepsilon}\frac{e^{2iz}-1}{z^2}dz,$$  where $C_\varepsilon$ is the little negatively-oriented half-circle mentioned above.  Now, I know the trick in which the value of the right-hand side happens to give exactly $\pi i \text{Res}(f,0)$ (that is, half of what the full circle would give), and can use it to show that the result is $-2\pi$.  Okay, thanks for reading this far. Here is my actual question: Without resorting to tricks like the half-residue thing, how can we get this result from the right-hand side? That is, how do we prove rigorously that:  $$\lim\limits_{\varepsilon\to 0}\int\limits_{C_\varepsilon}\frac{e^{2iz}-1}{z^2}dz=-2\pi$$  I have been using the parametrization $z=\varepsilon e^{-it}$ with $t\in[0,\pi]$, where the negative in the exponential deals with the negative orientation, which almost always works in these situations, but not here, since the $\varepsilon$ does not entirely cancel from the denominator then as it usually does in these types of problems.  I have confirmed the result with Wolfram-Alpha using the original problem statement, and also noted a few other things, like that the original integrand can be expressed as $\frac{\sin^2(x)}{x^2}$, but gotten nowhere with that.  In a pinch, I'll use the 'half-residue' trick, but being able to do this simply from basic principles would be nice.
24687
According to some reliable sources, the residue theorem can be stated as: the sum of residues of a function on the whole complex plane(including infinity) is zero.  Now consider $$f(x) = \frac{\csc(\pi/x)}{x^2}$$ which has singularities at $+1, -1, 0, \infty$.  By Laurent expansion, I found that the residue is $\frac{1}{\pi}$ for $1, -1$ and $0$, and the residue at infinity is $\frac{-1}{\pi}$.  Obviously, this contradicts the residue theorem.  What mistakes did I make?
39954
Calculate  $$\int^{\infty}_{0}\frac{\ln^2(x)}{(1-x^2)^2}dx$$   I have tried to put $\displaystyle x=\frac{1}{t}$ and $\displaystyle dx=-\frac{1}{t^2}dt$  $$ \int^{\infty}_{0}\frac{t^2\ln^2(t)}{(t^2-1)^2}dt$$  $$\frac{1}{2}\int^{\infty}_{0}t\ln^2(t)\frac{2t}{(t^2-1)^2}dt$$  $$ \frac{1}{2}\bigg[-t\ln^2(t)\frac{1}{t^2-1}+\int^{\infty}_{0}\frac{\ln^2(t)}{t^2-1}+2\int^{\infty}_{0}\frac{\ln(t)}{t^2-1}dt\bigg]$$  How can I solve it?
100559
I must find the residues of $z^2\sin(\frac{1}{z})$ at $z = 0$.  Since $z = 0$ seems to be an Essential Singularity, i'm not sure how I can continue to find the residue of the function. Usually I am able to apply the Taylor Series and then find the $z^{-1}$ coefficient, but in this case I do not get a $z^{-1}$ term.
66164
I am interested to compute the following integral  $$I=\int_{0}^{+\infty}\frac{\cos x}{a^2+x^2}dx$$  where $a\in\mathbb{R}^+$. Let me explain my first idea. As the integrand is an even function of $x$ then  $$2I=\int_{-\infty}^{+\infty}\frac{\cos x}{a^2+x^2}dx=\lim_{R\to+\infty}\int_{-R}^{R}\frac{\cos x}{a^2+x^2}dx:=\lim_{R\to+\infty}J$$  So, I first focus on computing the $J$ integral by first modifying it as follows  \begin{align*} J&amp;=\int_{-R}^{R}\frac{\cos x}{a^2+x^2}dx=\int_{-R}^{R}\frac{\cos x}{a^2+x^2}dx+i\int_{-R}^{R}\frac{\sin x}{a^2+x^2}dx \\ &amp;= \int_{-R}^{R}\frac{(\cos x+i\sin x)}{a^2+x^2}dx = \int_{-R}^{R}\frac{\exp(ix)}{a^2+x^2}dx \end{align*}  Then, I use the well-known techniques of complex variable theory. First, I replace the real variable $x$ in $J$ with a complex variable $z$ and consider a contour integral over $C=C_1\cup C_2$  $$K:=\int_{C}\frac{\exp(iz)}{a^2+z^2}dz$$    Then, according to the Cauchy's integral theorem and the Residue theorem, I get  \begin{align*} K=J+\int_{C_2}\frac{\exp(iz)}{a^2+z^2}dz &amp;= \int_{C_3}\frac{\exp(iz)}{a^2+z^2}dz=\int_{C_3}\frac{\exp(iz)}{(z+ia)(z-ia)}dz \\ &amp;=2\pi i \frac{\exp(i^2a)}{2ia}=\frac{\pi}{a}\exp(-a) \end{align*}  Next, taking the limit $R\to+\infty$ from the above relation, we obtain  $$2I+\lim_{R\to+\infty}\int_{C_2}\frac{\exp(iz)}{a^2+z^2}dz=\frac{\pi}{a}\exp(-a)$$  but, we can show that   $$\lim_{R\to+\infty}\int_{C_2}\frac{\exp(iz)}{a^2+z^2}dz=0$$  and then we can obtain the final result  $$I=\frac{\pi}{2a}\exp(-a)$$     First, please check my steps to see the final result is correct or not. Second, is there any other way to compute $I$?
40112
Evaluate $$\int_0^\infty\frac{\ln x}{1+x^2}\ dx$$ I don't know where to start with this so either the full evaluation or any hints or pushes in the right direction would be appreciated.  Thanks.
70543
Is there a good way to compute the residue of $f(z)=\dfrac{1+z}{1-\sin z}$ at $z=\pi/2$, which is a pole of order $2$?  Using the residue calculation formula yields  $$\text{Res}_{z=\pi/2}f(z)=\lim_{z\rightarrow\pi/2}\dfrac{d}{dz}\left(\left(z-\dfrac\pi2\right)^2f(z)\right)$$  The derivative is quite ugly, and calculating the limit requires L'Hospital probably twice (or more). The calculation is just too much. Is there a better way?
30020
I need to find $\displaystyle\int_{-\infty}^{\infty} \frac{\cos x}{x^{2} + a^{2}}\ dx$ where $a &gt; 0$. To do this, I set $f(z) = \displaystyle\frac{\cos z}{z^{2} + a^{2}}$ and integrate along the semi-circle of radius $R$. For the residue at $ia$ I get $\displaystyle\frac{\cos(ia)}{2ia}$. Then letting $R \rightarrow \infty$, the integral over the arc is zero, so I get $\displaystyle\int_{-\infty}^{\infty} \frac{\cos x}{x^{2} + a^{2}}\ dx = 2 \pi i \frac{\cos(ia)}{2ia} = \frac{\pi \cos(ia)}{a}$. But this is supposed to be $\displaystyle\frac{\pi e^{-a}}{a}$, so I am doing something wrong.  In a similar problem, I have to evaluate $\displaystyle\int_{-\infty}^{\infty} \frac{x \sin x}{x^{2} + a^{2}}\ dx$ and get $\pi i \sin(ia)$ whereas this is supposed to be $\pi e^{-a}$. I think I am getting some detail wrong in both cases. Can anyone enlighten me?
93670
The complex function $f(z)=\frac{1}{\sqrt{z^2+r_0z}}$ with $r_0&gt;0$ has two poles (at $z=0$ and $z=-r_0$). But they are not simple poles. They are poles of fractional order. Am I right? How I can calculate residue of the function at the poles? Please help me.   Thanks  Vahid
88391
The goal is to show (preferably without contour integration, as my knowledge is pretty limited there, but if you can do it that way there is no problem to share it) that: $$I= \int_0^1 \frac{x\ln\left(\frac{1+x}{1-x}\right)}{\left(\pi^2+\ln^2\left(\frac{1+x}{1-x}\right)\right)^2}\mathrm dx=\frac{1}{240}$$  I am still trying to find more relevant approaches, but so far I thought of: Considering $$J(a)= \int_0^1 \frac{x\ln\left(\frac{1+x}{1-x}\right)}{a^2+\ln^2\left(\frac{1+x}{1-x}\right)}dx$$ We have that $J'(\pi)=-2\pi I$, also $$J(a)=\int_0^\infty e^{-at}\int_0^1 x\sin\left(t\ln\left(\frac{1+x}{1-x}\right)\right)dx dt $$ Which is nice, however I couldnt solve the inner integral.  Another approach would be to let $\ln\left(\frac{1+x}{1-x}\right)=t \rightarrow x=\frac{e^t-1}{e^t+1}\rightarrow dx=\frac{2e^t}{(e^t+1)^2}$  $$I=2\int_0^\infty \frac{e^t(e^t-1)}{(e^t+1)^3}\frac{t}{(\pi^2+t^2)^2}dt$$ This doesnt look nice, but notice that $$\frac{d^2}{dx^2} \left(\frac{1}{1+e^x}\right)=\frac{e^x(e^x-1)}{(e^x+1)^3}$$ Integrating by parts two times I get $$I=\frac{1}{\pi^2} +24 \int_0^\infty \frac{x^2-\pi^2}{(x^2+\pi^2)^4}\frac{x}{1+e^x}dx$$ Now I am thinking to use series for $\frac{x}{1+e^x}$, but I dont know a series that satisfies it, similary we have for $\frac{x}{e^x-1}$ in terms of Bernoulli numbers. Could you land some help for this integral?
99158
I am to evaluate the following integral using residue theorem: $$\int_0^{2\pi} \frac {\cos(\theta)}{5-3\cos(\theta)} \, d\theta$$ I know that I need to perform substitution with the following: $$d\theta = \frac {dz}{iz}$$ $$\cos\theta = \frac 12(z+\frac1z)$$ which yields: $$\frac 1i=\int_{|z|=1} \frac{z+\frac1z}{-3z^2+10z-3}\, dz$$ Finding the roots for the denominator yields two roots at $1/3$ and $3.$ Only $1/3$ falls within our unit circle so we ignore the root at $3.$ This is where I am a little stuck. I was taught to use the shortcut here to calculate the residue where I would leave the numerator $p(z)$ as is and take the derivative of the denominator $q'(z)$ then plug in the value of the singularity $z=\frac13$ but this approach doesn't give me the correct answer which I know is $\frac\pi6$ Am I making a mistake in setting up the problem? Thanks!
83051
I'm trying to evaluate the integral $$ I =\int_{-1}^{1}\frac{\sqrt{1-x^{2}}}{1+x^{2}} \, dx $$ by using a dumbbell/dogbone contour, but I'm having difficulty determining the residue at infinity.  I started by defining  $\sqrt{1-z^{2}}=\sqrt{(1-z)(1+z)} $ so that it is a well-defined function if the line segment $[-1,1]$ is omitted.  Similar to an , I choose the branches where $0 &lt; \arg(1-z) \le 2 \pi$ and $-\pi &lt; \arg(1+z) \le \pi$.  Then I integrated $ f(z) = \frac{\sqrt{1-z^{2}}}{1+z^{2}}$ clockwise around a dumbbell contour.  Just above the branch cut, $\arg(1-z) = 2 \pi$ and $\arg(1+z) = 0$.  And just below the branch cut, $\arg(1-z) = 0$ and $\arg(1+z) = 0$.  So the integral evaluates to $-I$ both above the cut and below the cut.  Since the integrand is meromorphic outside the contour, I get  $$ - 2I =  2\pi i \left( \operatorname{Res}[f,i]+ \operatorname{Res}[f,-i]  + \operatorname{Res}[f,\infty] \right),$$ where  $$\begin{align}  \operatorname{Res}[f,i] &amp;=\lim_{z\to i }\frac{\sqrt{|1-z|e^{i\arg(1-z)}\ |1+z|e^{i\arg(1+z)}}}{z+i} =\frac{\sqrt{\sqrt{2}e^{\frac{7\pi i}{4}}\sqrt{2}e^{\frac{\pi i}{4}}}}{2i} \\ &amp;=\frac{\sqrt{2}e^{\pi i}}{2i}=-\frac{\sqrt{2}}{2i}, \end{align}$$  $$ \begin{align}\operatorname{Res}[f,-i] &amp;=\lim_{z\to-i }\frac{\sqrt{|1-z|e^{i\arg(1-z)}\ |1+z|e^{i\arg(1+z)}}}{z-i}=\frac{\sqrt{\sqrt{2}e^{\frac{\pi i}{4}}\sqrt{2}e^{\frac{-\pi i}{4}}}}{-2i} \\ &amp;=\frac{\sqrt{2}e^{ 0\pi i}}{-2i}=-\frac{\sqrt{2}}{2i}, \end{align}$$ and  $$ \begin{align}\operatorname{Res}[f,\infty] &amp;=\operatorname{Res}\left[-\frac{1}{z^{2}}f\left(\frac{1}{z}\right), 0 \right]= \operatorname{Res}\left[-\frac{\sqrt{z^2-1}}{z(1+z^{2})},0\right]\\ &amp;=-\lim_{z\to 0}\frac{\sqrt{z^2-1}}{1+z^{2}} = -(-1)^{\frac{1}{2}}. \end{align}$$  But what is $(-1)^{\frac{1}{2}}$?   I assume it must be $i$, but I don't know how to argue that it can't be $-i$.  EDIT:  There is also the issue that Ted Shifrin mentioned of assuming that $\sqrt{z^{2}}=z$.
106102
How do I find the value of $$\int_{0}^{\infty} \frac{(\ln z)^2}{1+z^2}\mathrm{d}z$$ without using contour integration, - using the usual special functions, e.g., zeta/gamma/beta/etc.  Thank you,