MHB A very basic question about integration

  • Thread starter Thread starter Saitama
  • Start date Start date
  • Tags Tags
    Integration
Saitama
Messages
4,244
Reaction score
93
I encountered this when I tried to evaluate the following integral with help of complex numbers.
$$\int_0^{\infty} \frac{dx}{x^2+1}$$
The answer is obviously $\pi/2$ as the integrand is derivative of $\arctan(x)$.

Now, I tried it it using partial fraction decomposition:
$$\int_0^{\infty} \frac{dx}{x^2+1}=\frac{1}{2i}\left(\int_0^{\infty} \frac{dx}{x-i}-\int_0^{\infty} \frac{dx}{x+i}\right)$$
$$=\frac{1}{2i}\left(\ln\left(\frac{x-i}{x+i}\right)\right|_0^{\infty}=\frac{-1}{2i}\ln(-1)$$
If I write $-1=e^{-i\pi}$, I get the correct answer but how do I justify writing $-1=e^{-i\pi}$? I mean why not $e^{-i3\pi}$ or $e^{-i5\pi}$?

Any help is appreciated. Thanks!
 
Physics news on Phys.org
Pranav said:
I encountered this when I tried to evaluate the following integral with help of complex numbers.
$$\int_0^{\infty} \frac{dx}{x^2+1}$$
The answer is obviously $\pi/2$ as the integrand is derivative of $\arctan(x)$.

Now, I tried it it using partial fraction decomposition:
$$\int_0^{\infty} \frac{dx}{x^2+1}=\frac{1}{2i}\left(\int_0^{\infty} \frac{dx}{x-i}-\int_0^{\infty} \frac{dx}{x+i}\right)$$
$$=\frac{1}{2i}\left(\ln\left(\frac{x-i}{x+i}\right)\right|_0^{\infty}=\frac{-1}{2i}\ln(-1)$$
If I write $-1=e^{-i\pi}$, I get the correct answer but how do I justify writing $-1=e^{-i\pi}$? I mean why not $e^{-i3\pi}$ or $e^{-i5\pi}$?

Any help is appreciated. Thanks!

Taqe into account that is...

$\displaystyle \int_{0}^{\infty} \frac{d x}{1 + x^{2}} = \frac{1}{2\ i}\ \{\ln 1 - \ln (-1)\}\ (1)$

... and both logarithms in (1) are defined les a term $2\ k\ \pi\ i$...

Kind regards

$\chi$ $\sigma$
 
chisigma said:
Taqe into account that is...

$\displaystyle \int_{0}^{\infty} \frac{d x}{1 + x^{2}} = \frac{1}{2\ i}\ \{\ln 1 - \ln (-1)\}\ (1)$

... and both logarithms in (1) are defined les a term $2\ k\ \pi\ i$...

Kind regards

$\chi$ $\sigma$

Okay, more stupid questions. Why is it invalid to take different values of $k$? I mean, why is it wrong to write $\ln 1=i2\pi$ and $\ln(-1)=-i3\pi$?
 
Last edited:
Pranav said:
Okay, more stupid questions. Why is it invalid to take different values of $k$? I mean, why is it wrong to write $\ln 1=i2\pi$ and $\ln(-1)=-i3\pi$?

... because all definite integrals are a difference ...

$\displaystyle \int_{a}^{b} f(x)\ dx = F(b) - F(a)\ (1)$

... and of course F(*) is the same function computed in b and a...

Kind regards

$\chi$ $\sigma$
 
chisigma said:
... because all definite integrals are a difference ...

$\displaystyle \int_{a}^{b} f(x)\ dx = F(b) - F(a)\ (1)$

... and of course F(*) is the same function computed in b and a...

Kind regards

$\chi$ $\sigma$

But how does that answer my question? :confused:

$\ln(1)=i2\pi$ and $\ln(-1)=-i3\pi$, hence
$$\frac{1}{2i}\left(\ln(1)-\ln(-1)\right)=\frac{1}{2i}\left(i2\pi+i3\pi\right)=\frac{5\pi}{2}$$
Looks perfectly fine to me but it is definitely wrong.
 
Pranav said:
But how does that answer my question? :confused:

$\ln(1)=i2\pi$ and $\ln(-1)=-i3\pi$, hence
$$\frac{1}{2i}\left(\ln(1)-\ln(-1)\right)=\frac{1}{2i}\left(i2\pi+i3\pi\right)=\frac{5\pi}{2}$$
Looks perfectly fine to me but it is definitely wrong.
You have to make sure that you use the same branch of the logarithm function at both ends of the contour. In other words, given the integral $\left.\ln\left(\frac{x-i}{x+i}\right)\right|_0^{\infty}$, you can choose which value of $\ln 1$ that you want to use at the $x=\infty$ end of the contour. But you must then trace the value of $\ln\left(\frac{x-i}{x+i}\right)$ so that it varies continuously as $x$ goes from $\infty$ down to $0$. Then you are forced to use that value of $\ln(-1)$ when $x$ reaches $0$.
 
Opalg said:
You have to make sure that you use the same branch of the logarithm function at both ends of the contour. In other words, given the integral $\left.\ln\left(\frac{x-i}{x+i}\right)\right|_0^{\infty}$, you can choose which value of $\ln 1$ that you want to use at the $x=\infty$ end of the contour. But you must then trace the value of $\ln\left(\frac{x-i}{x+i}\right)$ so that it varies continuously as $x$ goes from $\infty$ down to $0$. Then you are forced to use that value of $\ln(-1)$ when $x$ reaches $0$.

Thanks Opalg! That looks like a valid explanation but I am currently unable to understand it. I don't know what you mean by "same branch of the logarithm function at both ends of the contour", probably something related to contour integration? If so, I guess I should leave it then. :o
 
Pranav said:
Thanks Opalg! That looks like a valid explanation but I am currently unable to understand it. I don't know what you mean by "same branch of the logarithm function at both ends of the contour", probably something related to contour integration? If so, I guess I should leave it then. :o

Hey Pranav!

The same thing happens in the real domain.

You said that the anti-derivative of $\frac 1{x^2+1}$ is $\arctan x$.
However, the inverse of $\tan x$ actually has multiple branches.
Properly it should be $\arctan x + k\pi$.
It is just conventional to always pick $\arctan x$, which is the principle branch.
This is similar to how $\text{Ln }z$ is the principle branch of $\ln z$ when using complex numbers.

If you would calculate the integral with different branches of the inverse of $\tan x$, you'd also get an extra $k\pi$.
This $k\pi$ corresponds to a series of full periods of $\tan x$.
 
Generally abvoid using complex numbers when evaluating real integrals unless you are integrating in the complex plain because you are assuming many things like the function has an anti-derivative. The prediocity of the complex exponential makes the logarithm a multi-valued function and to define it as a differentiable function we have first to make it single-valued and this is done by choosing an appropriate branch. This branch has to define an analtic function in the interval of integration. You have to have a knowledge of complex analysis in order to work comfortably with complex valued functions.
 
  • #10
Pranav said:
Thanks Opalg! That looks like a valid explanation but I am currently unable to understand it. I don't know what you mean by "same branch of the logarithm function at both ends of the contour", probably something related to contour integration? If so, I guess I should leave it then. :o

Complex functions can have multiple "branches". Take the square root function, for example. Why is the "proof"
$$-1=\sqrt{(-1)(-1)}=\sqrt{1\cdot 1}=1$$
wrong? Because the step $\sqrt{(-1)(-1)}=\sqrt{1\cdot 1}$ assumes you can just cross the negative real axis without any trouble. But the square root function has what we call a "branch cut discontinuity" on the negative real axis, that prevents you from doing just this kind of traversing. Here's a visualization of this idea applied to the logarithm function. To keep traversing these functions without incurring the wrath of complex analysts (and getting the wrong answer), you need to specify where you are on the spiral, in this case.
 
  • #11
Ackbach said:
Complex functions can have multiple "branches". Take the square root function, for example. Why is the "proof"
$$-1=\sqrt{(-1)(-1)}=\sqrt{1\cdot 1}=1$$
wrong? Because the step $\sqrt{(-1)(-1)}=\sqrt{1\cdot 1}$ assumes you can just cross the negative real axis without any trouble. But the square root function has what we call a "branch cut discontinuity" on the negative real axis, that prevents you from doing just this kind of traversing. Here's a visualization of this idea applied to the logarithm function. To keep traversing these functions without incurring the wrath of complex analysts (and getting the wrong answer), you need to specify where you are on the spiral, in this case.

I like Serena said:
Hey Pranav!

The same thing happens in the real domain.

You said that the anti-derivative of $\frac 1{x^2+1}$ is $\arctan x$.
However, the inverse of $\tan x$ actually has multiple branches.
Properly it should be $\arctan x + k\pi$.
It is just conventional to always pick $\arctan x$, which is the principle branch.
This is similar to how $\text{Ln }z$ is the principle branch of $\ln z$ when using complex numbers.

If you would calculate the integral with different branches of the inverse of $\tan x$, you'd also get an extra $k\pi$.
This $k\pi$ corresponds to a series of full periods of $\tan x$.

Both of these are wonderful explanations. Thanks a lot ILS and Ackbach! :)

ZaidAlyafey said:
...You have to have a knowledge of complex analysis in order to work comfortably with complex valued functions.

I guess I should start with it. :p
 
Back
Top