# Contour Integral Help

Gold Member

## Homework Statement

Using contour integration, evaluate ##\int_{0}^{\infty} \frac{\sqrt{x}}{x^3 + 1} dx##.

## The Attempt at a Solution

Normally what I try to do in these problems is consider the upper half of a semi-circle from -R to R in the complex plane, as R goes to infinity. In doing so, I've found the residues as:

##\frac{1}{3}e^{i\frac{\pi}{2}}## at the pole ##z = e^{-i\frac{\pi}{3}}##;

##\frac{1}{3}e^{-3i\frac{\pi}{2}}## at the pole ##z = -1##;

##\frac{1}{3}e^{-i\frac{\pi}{2}}## at the pole ##z = e^{i\frac{\pi}{3}}##.

Summing and multiplying by ##2 \pi i## yields ##-\frac{2 \pi}{3}##.

However, what I've noticed is that my (real) integral is only defined for x ≥ 0. Does this mean I should consider instead the upper half of a semi-circle from 0 to R as R goes to infinity, so that only the pole ##z = e^{i\frac{\pi}{3}}## lies in my contour? The problem is, when I do that, I end up getting ##\frac{2 \pi}{3}##... still not the correct answer which is apparently ##\frac{\pi}{3}##.

What am I doing wrong here?

Ackbach
Gold Member

## Homework Statement

Using contour integration, evaluate ##\int_{0}^{\infty} \frac{\sqrt{x}}{x^3 + 1} dx##.

## The Attempt at a Solution

Normally what I try to do in these problems is consider the upper half of a semi-circle from -R to R in the complex plane, as R goes to infinity. In doing so, I've found the residues as:

##\frac{1}{3}e^{i\frac{\pi}{2}}## at the pole ##z = e^{-i\frac{\pi}{3}}##;

##\frac{1}{3}e^{-3i\frac{\pi}{2}}## at the pole ##z = -1##;

##\frac{1}{3}e^{-i\frac{\pi}{2}}## at the pole ##z = e^{i\frac{\pi}{3}}##.

Summing and multiplying by ##2 \pi i## yields ##-\frac{2 \pi}{3}##.

However, what I've noticed is that my (real) integral is only defined for x ≥ 0. Does this mean I should consider instead the upper half of a semi-circle from 0 to R as R goes to infinity, so that only the pole ##z = e^{i\frac{\pi}{3}}## lies in my contour?

That's probably what I would do. Then you have three contours to worry about:
$$\gamma_{1}: 0 \to R, \quad \gamma_{2}: R \to iR, \quad \gamma_{3}: iR \to 0.$$
The first leg is a straight line (and the one in which you're interested), the second leg is a quarter-circle, and the last leg is again a straight line. The sum
$$\int_{\gamma_{1}}+ \int_{\gamma_{2}}+ \int_{\gamma_{3}}=2\pi i \cdot \text{Res} \left[ \,f(z), e^{i\frac{\pi}{3}} \right].$$
You can probably use the ##ML## inequality on the second leg. And if you can find a way to compute the third leg, then you have that
$$\int_{0}^{\infty} \frac{ \sqrt{x}}{x^{3}+1} \, dx=2\pi i \cdot \text{Res} \left[ \,f(z), e^{i\frac{\pi}{3}} \right] - \int_{ \gamma_{3}}.$$
See how that works for you.

Last edited:
haruspex
Homework Helper
Gold Member
2020 Award
you have three contours to worry about:
$$\gamma_{1}: 0 \to R, \quad \gamma_{2}: R \to iR, \quad \gamma_{3}: iR \to 0.$$
The first leg is a straight line (and the one in which you're interested), the second leg is a quarter-circle, and the last leg is again a straight line.
The last leg looks messy. I would suggest using a different angle between the first and last legs.

1 person
I find your lack of observation disturbing. Try the substitution $x^{3/2} = u$, and then look if the integral turns into something simpler.

haruspex
Homework Helper
Gold Member
2020 Award
I find your lack of observation disturbing. Try the substitution $x^{3/2} = u$, and then look if the integral turns into something simpler.

I read the OP as dictating use of contour integration. Simplifying instead or first with a substitution might not be quite in the spirit.

WannabeNewton
I find your lack of observation disturbing.
This is uncalled for. There's no need to be rude; he is just asking for help. I find your lack of courtesy disturbing.

1 person
This is uncalled for. There's no need to be rude; he is just asking for help. I find your lack of courtesy disturbing.

It is not being rude, it is simply a reference to Star Wars.

The OP dictates the use of contour integration, but the same contour integration can also be applied to the resulting integral after that substitution if you need to use it due to the question.

What am I doing wrong here?

You should consider the integral in the complex plane:

$$\int_{\gamma} \frac{\sqrt{z}}{z^3+1}dz$$

with the contour $\gamma$, a keyhole contour traversing over a selected analytic determination of the square root function and the key-slot over the positive real axis. Can you do the integration over the legs of that contour? Need to take care when computing residues over branches that way right?

Last edited:
vanhees71
Gold Member
But the OP is supposed to calculate the integral from 0 to $\infty$ along the real axis, using contour integration. In this case one has to be careful that the additional paths added to the original one give no contribution to the integral. Another problem is that $z=0$ is an essential singularity of the integrand. Thus to have the contour running through this singularity may be troublesome. The hint with the substitution looks better to me. The suggestion given is thus fine. I'd use
$$u=x^{3/2}, \quad \mathrm{d} u = \mathrm{d} x \frac{3}{2} \sqrt{x}.$$
Then you get
$$I=\int_0^{\infty} \mathrm{d} x \frac{\sqrt{x}}{x^3+1}=\frac{2}{3} \int_0^{\infty} \mathrm{d} u \frac{1}{u^2+1} = \frac{1}{3} \int_{-\infty}^{\infty} \mathrm{d} u \frac{1}{u^2+1}.$$
This integral is easily evaluated by contour integration, closing the contour with a large semicircle (no matter whether in the upper or lower $u$-half plane).

But the OP is supposed to calculate the integral from 0 to $\infty$ along the real axis, using contour integration. In this case one has to be careful that the additional paths added to the original one give no contribution to the integral. Another problem is that $z=0$ is an essential singularity of the integrand. Thus to have the contour running through this singularity may be troublesome. The hint with the substitution looks better to me. The suggestion given is thus fine. I'd use
$$u=x^{3/2}, \quad \mathrm{d} u = \mathrm{d} x \frac{3}{2} \sqrt{x}.$$
Then you get
$$I=\int_0^{\infty} \mathrm{d} x \frac{\sqrt{x}}{x^3+1}=\frac{2}{3} \int_0^{\infty} \mathrm{d} u \frac{1}{u^2+1} = \frac{1}{3} \int_{-\infty}^{\infty} \mathrm{d} u \frac{1}{u^2+1}.$$
This integral is easily evaluated by contour integration, closing the contour with a large semicircle (no matter whether in the upper or lower $u$-half plane).

Got some problems with that vanhees:

(1) You mean select a contour so that we can express the unknown (real) integral in terms of the other knows integrals around the contour,

(2) Zero is a branch-point, not an essential singularity,

(3) By making that substitution, you obliterate the underlying technique of evaluating an integral over a multi-valued function, something that will come up again and again in Complex Analysis so might as well get good at it by practicing with them.

vanhees71
Gold Member
As far as I know, a branch point is an essential singularity, i.e., it is not an isolated pole.

The contour-integral technique is of course not necessary here, because after the substitutino you can evaluate the integral directly as well. It's nevertheless a nice execise to use the theorem of residues by closing the contour with a semicircle of infinite radius. It's easy to see that of course both calculations give the same result (which is $\pi/3$ by the way).

haruspex
Homework Helper
Gold Member
2020 Award
I don't see what's wrong with using Ackbeet's method but changing the path a little. After going out along the +ve real axis, instead of arcing around pi/2 and coming back down the +i axis, continue the arc a little further before travelling a straight line back to the origin. With the right choice of angle, it gives the right answer quite easily.

1 person
vanhees71
Gold Member
How do you prove that the added path, not at infinity, do not contribute to the integral? Closing the path on the substituted integral with a semicircle at infinity doesn't have this problem.

I also still don't see, how you make sense of original the integral along a path containing the origin. Of course, you can take out a little region around the origin.

Well, I noticed something interesting.
In the webpage http://math.fullerton.edu/mathews/c2003/IntegralsBranchPointsMod.html [Broken], there is a Theorem 8.7 that gives the result for this integral as $-\pi/3$.

Quite strange, don't you think? Our integrand satisfies all the requirements of the theorem.

Here is the proof I found for the said theorem.

Last edited by a moderator:
vanhees71
Gold Member
Well, then there is something wrong, because obviously the integral is positive, isn't it? One has to be very careful, on which Riemann sheet you work and where you put the cut. I still think, doing the substitution for the real integral first ist much more save ;-)).

Ignore that post, the branch cut of the logarithm is being taken as the positive real axis in the proof. It should be the negative real axis. Constructing the keyhole like that and modifying the integrand appropriately gives the proper answer $\pi/3$, however I don't know why they made such a mistake in the proof.

I also still don't see, how you make sense of original the integral along a path containing the origin. Of course, you can take out a little region around the origin.

Yes vanheees, that's what you do: you indent around the origin and let the radius of the indentation go to zero. Sometimes this contribution is zero and sometimes it's not for a particular integrand.

As far as I know, a branch point is an essential singularity, i.e., it is not an isolated pole.

A branch-point is a non-isolated singular point and so is not a pole which must be isolated by definition. An essential singularity, isolated or not, is one which has a power expansion with negative exponents which do not terminate. The power expansion for $\sqrt{z}$ is $\sqrt{z}$, i.e, it's finite.

Ok, what I would now like since we're having problems with this is for someone to post a complete, detailed solution to this problem including a nice illustration of a key-hole contour, color-coded preferably, and a nice explanation of the relationship between a particular determination of the square root function such as $\log(z)=\ln|r|+i\theta,\quad 0\leq \theta<2\pi$, and the residue calculations.

Last edited:
Alright, here is a full solution to the problem: (No illustration, sorry :P)

Consider a keyhole contour that has the keyhole around the negative real axis, the branch cut for the complex logarithm. Start from the bottom left corner of the keyhole and traverse a big circle of radius $R$ counterclockwise; call this circle $C_1$. Now, go from $-R$ to $-\varepsilon$. Call this line segment $C_2$. Traverse a circle around the origin of radius $\varepsilon$ clockwise; call this circle $C_3$. Finally, draw a line underneath the negative real axis from $-\varepsilon$ to $-R$; call this line $C_4$. Call the entire contour $C$.

An illustration could save time, but meh.

Now, call $\displaystyle f(z)=\frac{\sqrt{z}}{z^3+1}$. We consider the contour integral $\displaystyle \int_{C} f(-z)\,dz$.

It is trivial to show that the integrals on $C_1$ and $C_3$ vanish. The poles of the integrand are all inside the contour, and their residues add up to $-\dfrac{i}{3}$, which gives us $\displaystyle \int_{C} f(-z)\,dz = \int^{-\varepsilon}_{-R} f(-z)\,dz + \int^{-R}_{-\varepsilon}f(-z)\,dz = \frac{2\pi}{3}$.

The traversion of $C_3$ gives us an argument bonus of $-2\pi$ when integrating over $C_4$; which expresses itself as an additional negative sign due to the square root. This, after rearranging and performing the variable transformation $z\to -z$, gives us the final result that $\displaystyle 2\int^{\infty}_{0}f(z)\,dz = \frac{2\pi}{3}$.

Alright, here is a full solution to the problem: (No illustration, sorry :P)

Consider a keyhole contour that has the keyhole around the negative real axis

You're integrating over a pole that way. Remember $z=-1$ is a singular point of the function. You'd have to make accommodations for indenting around that pole.

Now, call $\displaystyle f(z)=\frac{\sqrt{z}}{z^3+1}$. We consider the contour integral $\displaystyle \int_{C} f(-z)\,dz$.

It is trivial to show that the integrals on $C_1$ and $C_3$ vanish. The poles of the integrand are all inside the contour, and their residues add up to $-\dfrac{i}{3}$, which gives us $\displaystyle \int_{C} f(-z)\,dz = \int^{-\varepsilon}_{-R} f(-z)\,dz + \int^{-R}_{-\varepsilon}f(-z)\,dz = \frac{2\pi}{3}$.

The traversion of $C_3$ gives us an argument bonus of $-2\pi$ when integrating over $C_4$; which expresses itself as an additional negative sign due to the square root. This, after rearranging and performing the variable transformation $z\to -z$, gives us the final result that $\displaystyle 2\int^{\infty}_{0}f(z)\,dz = \frac{2\pi}{3}$.

Ok, that is way too complicated to follow. Why not just place the key-slot over the positive real axis instead and do away with that -z thing? The only concern is that when we do that, we're using the determination $\log(z)=\ln|r|+i\theta,\quad 0\leq \theta<2\pi$ so that the value of $\sqrt{e^{-\pi i/3}}=e^{5\pi i/6}$ when we compute the residue for that value.

vanhees71
Gold Member
Ok, I hope that's allowed now. I was told that one should not post complete solutions in this section of the forum.

Solution 1
-----------

My solution, I suggested before, is to first substitute $u=x^{2/3}$. Then the integral goes over to
$$I=\frac{1}{3} \int_{-\infty}^{\infty} \mathrm{d} u \frac{1}{u^2+1}.$$
(a) The direct solution is to directly integrate this:
$$I=\left . \frac{1}{3} \arctan u \right |_{u \rightarrow -\infty}^{u \rightarrow \infty}=\frac{\pi}{3}.$$

(b) Alternatively you can use the theorem of residues by closing the contour with a semicircle in the upper complex u plane. The integrand has two simple poles at $u=\pm \mathrm{i}$. The one in the upper plane is $+\mathrm{i}$. The residuum is
$$\lim_{u \rightarrow \mathrm{i}} \frac{1}{3} \frac{u-\mathrm{i}}{u^2+1}=\frac{1}{6 \mathrm{i}},$$
and thus you find again
$$I=2 \pi \mathrm{i} \frac{1}{6 \mathrm{i}}=\frac{\pi}{3}.$$

Solution 2
-----------

Without doing the substitution in the real integral the problem is more complicated. The only way I can imagine is to define a contour $\mathcal{C}$ running parallel to the negative real axis somewhat above the real axis, then a small semicircle around the origin then parallel to the real axis back to $-\infty$. Then you can close the contour by a large circle (leaving out the infinitesimal gap along the negative real axis) at infinity. Then you have a closed path and you can evaluate the integral
$$I'=\int_{\mathcal{C}} \mathrm{d} z=\frac{\sqrt{z}}{z^3-1}.$$
For the square root we use the principal branch, i.e., $\sqrt{z}>0$ for real $z>0$ and the branch cut along the negative real axis.

Then on the one hand you can use the theorem of residues. All three poles 1, $\exp(\pm \mathrm{i}/3$ with residua +1/3, -1/3, -1/3 of the integrand are inside the contour. Thus you get
$$I'=-\frac{2 \pi \mathrm{i}}{3}.$$

On the other hand you can directly write down the integrals along the real axis. Take the parametrizations
$$\mathcal{C}_1: z=-\lambda + \mathrm{i} 0^+, \quad \mathcal{C}_2=-\lambda - \mathrm{i} 0^+.$$
Noting that for $\mathcal{C}_1$ $\lambda$ runs from $-\infty$ to 0 and for $\mathcal{C}_2$ from 0 to $-\infty$, this gives
$$-\frac{2 \pi \mathrm{i}}{3}=I'=-2 \mathrm{i}\int_0^{\infty} \frac{\sqrt{\lambda}}{\lambda^3+1}.$$
This gives again
$$I=\int_0^{\infty} \mathrm{d} \lambda \frac{\sqrt{\lambda}}{\lambda^3+1}=\frac{\pi}{3}.$$
This is a pretty inconvenient way compared to solution 1 ;-).

Ok, I hope that's allowed now. I was told that one should not post complete solutions in this section of the forum.

I forgot about that and I'm not sure that's allowed even now. Sorry about that. Mostly I was just playing to suggest that even though the work to post the complete solution in my opinion is very educational for the poster and also for other readers.

I really think my way is the classiest way of working the problem. For one thing, it's an easy problem so we can make the substitution but later, you'll encounter more difficult problems and cannot make any substitution so the knowledge gained with this easy problem doing it my way, would be helpful with more complicated problems.

haruspex
Homework Helper
Gold Member
2020 Award
How do you prove that the added path, not at infinity, do not contribute to the integral?
It doesn't go to zero. Come in along θ = 2π/3 and compare the integral with the one out along the real axis.

vanhees71
Gold Member
Ok, I realized that your idea is equivalent to my solution 2. You just choose the branch cut for $\sqrt{z}$ along the positive real axis. So that would be

Solution 3
=======

With the branch cut along the positive real axis you define the square root $z=r \exp(\mathrm{i} \varphi)$ with $\varphi \in (0,2 \pi)$:
$$\sqrt{z}=\sqrt{r} \exp(\mathrm{i} \varphi/2).$$
Here, the square root of the positive $r=|z|$ is meant to be positive as usual for the real square root.

Then the integral along the parts of the contour parallel to the positive real axis give
$$2I=\int_0^{\infty} \frac{2 \sqrt{r}}{r^3+1}.$$

On the other hand the residues for the poles at $-1$, $\exp(\pm \mathrm{i} \pi/3$ are $\mathrm{i}/3$, $-\mathrm{i} \pi/3$, and $-\mathrm{i}/3$. Thus, according to the theorem of residues you find
$$2I=2 \pi \mathrm{i} \frac{-\mathrm{i}}{3}=\frac{2 \pi}{3},$$
which again leads to the correct result, $I=\pi/3$.

You're integrating over a pole that way. Remember $z=-1$ is a singular point of the function. You'd have to make accommodations for indenting around that pole.

Ok, that is way too complicated to follow. Why not just place the key-slot over the positive real axis instead and do away with that -z thing? The only concern is that when we do that, we're using the determination $\log(z)=\ln|r|+i\theta,\quad 0\leq \theta<2\pi$ so that the value of $\sqrt{e^{-\pi i/3}}=e^{5\pi i/6}$ when we compute the residue for that value.

I am not integrating a pole of the function. I am integrating $f(-z)$; not $f(z)$. So the pole at -1 is now at 1.

Gold Member
Thanks for the replies everyone.

I did not use a substitution because then the integral would reduce to an arctan integral, where the problem is trivial (like a few problems in this exercise). That is why I do not want to use one.

In my own time I came up with a solution but I am unsure if it is correct; I would appreciate it if someone could look at it.

First, observe this diagram:

Call this curve C, traversed along ABDEFGHJ. The smaller circle (the keyhole) is of radius r, the larger circle is of radius R. In other words:

$$\oint_{C} \frac{\sqrt{z}}{1 + z^3}dz = \int_{AB} + \int_{BDEFG} + \int_{GH} + \int_{HJA}$$

We have a branch point at z = 0 (because of the square root) and the poles are at z = e, z = eiπ/3 and z = e-iπ/3. All of these lie in our contour. Summing the residues at these points and multiplying by 2iπ gives 2π/3.

So now we have

$$\int_{AB} + \int_{BDEFG} + \int_{GH} + \int_{HJA} = \frac{2\pi}{3}$$

Note that:

$$\int_{AB} = \int_{r}^{R} \frac{\sqrt{z}}{1 + z^3}dz$$

Using the substitution z = Re in the second integral yields:

$$\int_{BDEFG} = \int_{0}^{2\pi} \frac{ \sqrt{Re^{i\theta}} \cdot iRe^{i\theta}}{1 + R^{3}e^{3i\theta}}d\theta$$

For the third integral, we replace z with ze2iπ, as we have gone through a rotation of 2π to get to this point:

$$\int_{FG} = \int_{R}^{r} \frac{ \sqrt {ze^{2i \pi}}} {1 + (ze^{2i\pi})^{3}} dz = e^{i\pi} \int_{R}^{r} \frac {\sqrt{z}}{1 + z^3}dz$$

For the fourth integral, we use the same substitution as we did for the second integral, except with z = re:

$$\int_{HJA} = \int_{2\pi}^{0} \frac{ \sqrt{re^{i\theta}} \cdot ire^{i\theta}}{1 + r^{3}e^{3i\theta}}d\theta$$

Putting it all together:

$$\int_{r}^{R} \frac{\sqrt{z}}{1 + z^3}dz + \int_{0}^{2\pi} \frac{ \sqrt{Re^{i\theta}} \cdot iRe^{i\theta}}{1 + R^{3}e^{3i\theta}}d\theta + e^{i\pi} \int_{R}^{r} \frac {\sqrt{z}}{1 + z^3}dz + \int_{2\pi}^{0} \frac{ \sqrt{re^{i\theta}} \cdot ire^{i\theta}}{1 + r^{3}e^{3i\theta}}d\theta$$

$$= \frac{2\pi}{3}$$

Now, letting r -> 0 and R -> ∞, the second and fourth integrals vanish, and we have:

$$\int_{0}^{\infty} \frac{ \sqrt{z}}{1 + z^3}dz + e^{i\pi} \int_{\infty}^{0} \frac{ \sqrt{z}}{1 + z^3}dz = \frac{2\pi}{3}$$

which gives

$$2\int_{0}^{\infty} \frac{ \sqrt{z}}{1 + z^3}dz = \frac{2\pi}{3}$$

$$\therefore \int_{0}^{\infty} \frac{ \sqrt{z}}{1 + z^3}dz = \frac{\pi}{3}$$