# Challenge 4: There's no app for that: integration

Staff Emeritus
Gold Member
a.) Poor Wolfram Alpha got asked to calculate the following integral
$$\int_{0}^{\infty} e^{-ax} \frac{\sin(x)}{x} dx$$
but couldn't handle it!

http://www.wolframalpha.com/input/?i=int_{0}^{infty}+e^{-ax}+sin(x)+/xdx

(Results are not guaranteed if you use wolfram alpha pro to spend more time calculating as I don't have that).

Prove that you're smarter than a computer and solve this integral for all a > 0.

b.) For reasons unknown, Wolfram Alpha can solve this exactly if a is an integer, but it won't tell the steps for how it solved it. As a side challenge, instead calculate the integral in a way that only works if a is an arbitrary positive or non-negative (your choice) integer.

Feel free to answer either a, b or a and b.

mfb
Mentor
a.) Poor Wolfram Alpha got asked to calculate the following integral
$$\int_{0}^{\infty} e^{-ax} \frac{\sin(x)}{x} dx$$
but couldn't handle it!
Lie! :p.
If you enter a decimal number, the result is always a decimal number. If you enter an exact non-negative number (does not matter if integer or not, try 4/7 or pi or whatever), you get an exact result. A variable works as well, if you make sure it is positive.

a=0 leads to the sine integral and the result is pi/2.

Staff Emeritus
Gold Member
Well I figure if it can this it should be able to figure out the one in the challenge. At any rate it's a nice integral that admits a bunch of neat tricks to solving it so have at it!

I see now that perhaps part b was from my misunderstanding of how wolfram alpha operates - I tested it with things like a=2.1 and a=3.2 to see if it would calculate those and it just gave a decimal, but now I'm guessing that's just a quirk in how wolfram alpha interprets the output form that I want?

Last edited:
How about if we start by letting:

$$I(a)=\int_0^{\infty} e^{-ax} \frac{\sin(x)}{x}dx,\quad I(0)=\pi/2$$

And it would be nice if we could compute $\frac{dI}{da}$ as that would rid the denominator of $x$. Not sure if that integrand satisfies Leibniz's criteria for differentiating under the integral sign though.

We have that $$\int_{0}^{∞}e^{-ax}\frac{\sin(x)}{x}dx = \lim_{t→∞}\int_{0}^{t}e^{-ax}\frac{\sin(x)}{x}dx = \lim_{t→∞} I(a, t)$$

According to http://en.wikipedia.org/wiki/Differentiation_under_the_integral_sign, Leibniz's theorem is true if both $e^{-ax}\frac{\sin(x)}{x}$ and $-e^{-ax}\sin(x)$ are continuous on the region $0 ≤ x ≤ t, 0 ≤ a < ∞$

This is true (obvious for any nonzero x). The only trouble is when x is zero.
Define $ψ(a,x) = e^{-ax}\frac{\sin(x)}{x}, x ≠ 0$ and $ψ( a, 0 ) = 1$
Then $ψ(a,x)$ is equal to the integrand except perhaps at x = 0, but one point does not affect the value of the integral $I(a,t) = \int_{0}^{t}e^{-ax}\frac{\sin(x)}{x}dx = \int_{0}^{t}ψ(a,x)dx$
But since $\lim_{x→0}\frac{\sin(x)}{x} = 1$, the limit and the value $ψ(a,0)$ coincide so $ψ$ is indeed continuous on the region of interest.

Now applying Leibniz's rule, we get:
$$\frac{∂}{∂a}I(a,t) = \int_{0}^{t}-e^{-ax}\sin(x)dx = e^{-at}\left( \frac{a}{a^2+1}\sin(t) + \frac{1}{a^2+1}\cos(t) \right) - \frac{1}{a^2+1}$$

This is bounded above by $e^{-at} - \frac{1}{a^2+1}$ and below by $-e^{-at}-\frac{1}{a^2+1}$
Therefore, the sequence of derivatives $\frac{∂}{∂a} I(a,t), t → ∞$ converges uniformly to $-\frac{1}{a^2+1}$. Moreover, the sequence $I(a,t), t→∞$ converges (pointwise) to $I(a) = \int_{0}^{∞}e^{-ax}\frac{\sin(x)}{x}dx$ (by definition). Moreover, the functions are continuous and therefore integrable. I think these conditions are sufficient to ensure that the derivatives $\frac{∂}{∂a} I(a,t), t → ∞$ converge to $\frac{d}{da}I(a)$. Therefore, $I'(a) = -\frac{1}{a^2+1}$ and so:

$I(a) = I(0) - \arctan(a)$ where $I(0) = \int_{0}^{∞}\frac{\sin(x)}{x}dx = \frac{\pi}{2}$ is the Dirichlet integral.

$\int_{0}^{∞}e^{-ax}\frac{\sin(x)}{x}dx = \frac{\pi}{2} - \arctan(a)$.

I hope I have not overlooked something!

EDIT:
I realized that uniform convergence holds only on $0 < a < ∞$ so the equation $I'(a) = -\frac{1}{a^2+1}$ is guaranteed only for $a > 0$. I think this can be patched by showing that $I(a)$ is continuous at 0.

Last edited:
• 1 person
mfb
Mentor
Edit: Oh, has been solved 4 minutes before my post. I'll leave it here, maybe someone spots where I got wrong.

I tried a different approach, but I guess I have some sign/substitution errors somewhere.

First, let the lower integration border be ##\epsilon>0## and interpret the integral as limit of ##\epsilon \to 0## later.

Then
$$\int_{\epsilon}^{\infty} e^{-ax} \frac{\sin(x)}{x} dx = \frac{1}{2i} \int_{\epsilon}^{\infty} e^{-ax} \frac{e^{ix}-e^{-ix}}{x} dx = \frac{1}{2i} \left( \int_{\epsilon}^{\infty} \frac{1}{x}e^{-ax+ix} dx\; +\; \int_{\epsilon}^{\infty} \frac{1}{x}e^{-ax-ix} dx \right)$$

Consider the first integral:
$$\int_{\epsilon}^{\infty} \frac{1}{x}e^{-ax+ix} dx$$
This can be seen as integral in the complex numbers. The integrand has a pole at x=0 and nowhere else. Define:
##\displaystyle \theta=arctan(1/a)## (this is nice!) and ##A=|a+i|=\sqrt{a^2+1}##

We can use the upper red loop in the sketch to evaluate it. As the size of the loop goes to infinity, the contribution from the large curved section goes to zero (due to e-ax).

Let ##x=\frac{a+i}{A}r##. Then we can write the contribution from the inclined section as real integral:
$$\int_\epsilon^{\infty} \frac{A}{(a+i)r}e^{-Ar} dr = \frac{A}{a+i} \int_{\epsilon A}^{\infty} \frac{e^{-r}}{r} dr$$
We cannot take the limit ##\epsilon \to 0## at this point, and we cannot evaluate it either, so we just leave it. We have to count this negatively in the loop.

What about the small curved section? This is the classic integral over f(z)/z, the result is ##\theta f(0)## plus some expression that will vanish in the limit ##\epsilon \to 0## afterwards. Here, f(0)=e0=1, so the result is just ##\theta##. Again, we have to count this negatively.

Consider the second integral:
$$\int_{\epsilon}^{\infty} \frac{1}{x}e^{-ax-ix} dx$$
Follow the same procedure, just with ##x=\frac{a-i}{A}r##. The integral becomes
$$\int_\epsilon^{\infty} \frac{A}{(a-i)r}e^{-Ar} dr = \frac{A}{(a-i)} \int_{\epsilon A}^{\infty} \frac{e^{-r}}{r} dr$$
The small curved section gives ##\theta## again, this time with a positive sign, so the contributions cancel.

Our total integral is now 1/(2i) times the sum of the two real integrals obtained above:

$$\frac{1}{2i} A \frac{(a-1)+(a+1)}{A^2} \int_{\epsilon A}^{\infty} \frac{e^{-r}}{r} dr = -i \frac{a}{A} \int_{\epsilon A}^{\infty} \frac{e^{-r}}{r} dr$$
And here the problem is visible. This integral does not converge for ##\epsilon \to 0## (and the result is purely imaginary, literally and figuratively.).

#### Attachments

• 2.3 KB Views: 501
• 1 person
Yeah, that's what I need Boorglar: rigor to justify taking the derivative that way. Thanks.

Also mfb, spotted some mistakes:

(1) The first integral expression should be:

$$\int_{\epsilon}^{\infty} e^{-ax} \frac{\sin(x)}{x} dx = \frac{1}{2i} \int_{\epsilon}^{\infty} e^{-ax} \frac{e^{ix}-e^{-ix}}{x} dx = \frac{1}{2i} \left( \int_{\epsilon}^{\infty} \frac{1}{x}e^{-ax+ix} dx\; -\; \int_{\epsilon}^{\infty} \frac{1}{x}e^{-ax-ix} dx \right)$$

(2) An integral over an indentation around a simple pole at the origin for $f(z)/z$ (as radius goes to zero) is $\theta i f(0)$. You forgot the i.

Did it quick but looks like it ends up being:

$$\frac{1}{2 i} \left(i\arctan(1/a)+\int_0^{\infty} f(r)dr+i\arctan(1/a)-\int_0^{\infty}f(r) dr\right)$$

which then gives us the requisite $\arctan(1/a).$

Last edited:
mfb
Mentor
Oh, that sign was a stupid mistake.
I forgot the i, but as the contributions canceled (due to the sign error, crap) I did not check that again.

I'm not sure if the prefactors work out properly, if I just change the sign I don't get matching prefactors for the two integrals.

I'm not sure if the prefactors work out properly, if I just change the sign I don't get matching prefactors for the two integrals.
Ok, just to check it, I'll just let $z=re^{i\theta}$ on the top path and $z=re^{-i\theta}$ on the bottom path with $\theta=\arctan(1/a)$

For the top, I get:

$$\int_0^{\infty} \frac{e^{x(i-a)}}{x} dx=i\theta+\int_0^{\infty} \frac{e^{re^{i\theta}(i-a)}}{r}dr$$

and the bottom:

$$\int_0^{\infty} \frac{e^{-x(i+a)}}{x} dx=-i\theta+\int_0^{\infty} \frac{e^{-re^{-i\theta}(i+a)}}{r}dr$$

so that when we add everything up, we get the factor

$$\int_0^{\infty} \frac{e^{re^{i\theta}(i-a)}}{r}dr-\int_0^{\infty} \frac{e^{-re^{-i\theta}(i+a)}}{r}dr$$

and

$$e^{r e^{i\theta(i-a)}}-e^{-r e^{-i\theta(a+i)}}=0$$

for $\theta=\arctan(1/a)$.

mfb
Mentor
Okay. Good to see that the "direct" approach is possible.

Did it quick but looks like it ends up being:

$$\frac{1}{2 i} \left(i\arctan(1/a)+\int_0^{\infty} f(r)dr+i\arctan(1/a)-\int_0^{\infty}f(r) dr\right)$$

which then gives us the requisite $\arctan(1/a).$
I probably should have written that as:

$$\frac{1}{2 i} \left(i\arctan(1/a)+\int_0^{\infty} f(r,\theta)dr+i\arctan(1/a)-\int_0^{\infty}g(r,\theta) dr\right)$$

and $f(r,\theta)-g(r,\theta)=0$ for $\theta=\arctan(1/a)$.

Staff Emeritus
Gold Member
Boorglar, that's a really nice proof that you can take the derivative through the integral. You don't actually need to know what the value at a=0 is separately, since it's easy to calculate that as a goes to infinity the integral goes to zero.

jbunniii
Homework Helper
Gold Member
If we put
$$f(x) = \begin{cases} e^{-ax} & \text{ if }x \geq 0 \\ 0 & \text{ if }x < 0\end{cases}$$
and ##g(x) = \sin(x)/x##, then we need to evaluate ##I = \int_{-\infty}^{\infty} f(x) g(x) dx##, which we may also write as
$$I = \left.\int_{-\infty}^{\infty} f(x) g(x) e^{-iux} dx\right|_{u = 0}$$
This is the Fourier transform of ##fg##, evaluated at ##u=0##. If we denote ##\hat{f} = \mathcal{F}f## and ##\hat{g} = \mathcal{F}g##, the Fourier transforms of ##f## and ##g##, respectively, then we have ##\widehat{fg} = \hat{f} * \hat{g}##, where ##*## denotes the convolution operation: ##(\hat{f} * \hat{g})(u) = \int_{-\infty}^{\infty} \hat{f}(v) \hat{g}(u-v) dv##.

Our integral ##I## is equal to the convolution evaluated at ##u=0##: ##\int_{-\infty}^{\infty} \hat{f}(v) \hat{g}(-v) dv##. Let us evaluate ##\hat{f}## and ##\hat{g}##:

\begin{align} \hat{f}(u) &= \int_{0}^{\infty} e^{-ax} e^{-iux} dx \\ &= \int_{0}^{\infty} e^{-(a+iu)x} dx \\ &= \frac{1}{a+iu} \\ \end{align}
It's also well known that ##\sin(x)/x## has a "rectangular" Fourier transform:
$$\hat{g}(u) = \begin{cases} 1 & \text{ if }|u| < 1/2 \\ 0 & \text{ if }|u| > 1/2 \\ \end{cases}$$
(I'm probably missing a ##2\pi## scale factor somewhere.) Putting the pieces together, our integral is equivalent to
$$I = \int_{-1/2}^{1/2} \frac{1}{a + iu} du$$
which Wolfram Alpha tells me works out to ##2 \cot^{-1}(2a)##, but I don't remember which "stupid calculus trick" is needed to show this. Note that ##\cot^{-1}(x) = \pi/2 - \tan^{-1}(x)##, so my answer is close to Boorglar's except I screwed up a scale factor somewhere.

jbunniii
Homework Helper
Gold Member
Hmm, I guess I can do that last integral as follows:
\begin{align} I = \int_{-1/2}^{1/2} \frac{1}{a + iu} du &= \int_{-1/2}^{1/2}\frac{a-iu}{a^2 + u^2} du \\ &= \int_{-1/2}^{1/2} \frac{a}{a^2 + u^2} du \\ \end{align}
where the last equality holds because ##\int_{-1/2}^{1/2} \frac{u}{a^2 + u^2} du = 0## (the integrand is an odd function).
This should be handled by a trig substitution: ##u = a \tan \theta##. But I'm too tired to crank through the details.

CompuChip
Homework Helper
Cool mfb, I had a go at this problem for about 10 minutes earlier this week, and I got right up to your image but then got stuck / lost interest thinking about the additional contributions and running into the same problem with divergent integrals.

Staff Emeritus
Gold Member
jbunniii, I'm suspicious that you never plug in a u=0 anywhere.... at the end that integral looks like the product of the fourier transforms, not their convolution (which is easily fixed of course). That's a really clever way of attacking the problem.

Last edited:
jbunniii
Homework Helper
Gold Member
jbunniii, I'm suspicious that you never plug in a u=0 anywhere.... at the end that integral looks like the product of the fourier transforms, not their convolution (which is easily fixed of course). That's a really clever way of attacking the problem.
I do plug in ##u = 0##:
\begin{align} I &= \left.\int_{-\infty}^{\infty} f(x) g(x) e^{-iux} dx\right|_{u = 0} \\ &= \left.(\hat{f} * \hat{g})(u)\right|_{u=0}\\ &= \left.\int_{-\infty}^{\infty} \hat{f}(v) \hat{g}(u-v) dv\right|_{u=0}\\ &= \int_{-\infty}^{\infty} \hat{f}(v) \hat{g}(-v) dv \\ &= \int_{-\infty}^{\infty} \hat{f}(v) \hat{g}(v) dv \end{align}
where the last inequality follows because in our case ##\hat{g}## is an even function.

jbunniii
Homework Helper
Gold Member
I'll try to fix the scale factors later today if I have time.

Staff Emeritus
Gold Member
I see, I missed the fact that they end up looking exactly the same.

jbunniii
Homework Helper
Gold Member
My scale factor woes are a result of the ##2\pi## factor that appears in the formula for the inverse Fourier transform:
$$f(x) = \frac{1}{2\pi}\int_{-\infty}^{\infty}\hat{f}(u) e^{iux} du$$
One consequence of this is that the Fourier transform of ##fg## is in fact ##\frac{1}{2\pi}(\hat{f}*\hat{g})##, not ##\hat{f}*\hat{g}##. It also means that my Fourier transform of ##\sin(x)/x## dx was wrong. In fact, it should be
$$\hat{g}(u) = \begin{cases} \pi & \text{ if }|u| < 1 \\ 0 & \text{ if }|u| > 1 \\ \end{cases}$$
We verify this by calculating the inverse Fourier transform:
\begin{align} g(x) &= \frac{1}{2\pi}\int_{-\infty}^{\infty}\hat{g}(u) e^{iux} du \\ &= \frac{1}{2} \int_{-1}^{1} e^{iux} du \\ &= \frac{1}{2 i x} \left.e^{iux}\right|_{-1}^{1} \\ &= \frac{1}{2i x} (e^{ix} - e^{-ix}) \\ &= \frac{1}{ x} \left( \frac{e^{ix} - e^{-ix}}{2i} \right) \\ &= \frac{1}{ x} \sin(x) \\ &= \frac{\sin(x)}{x} \\ \end{align}
My calculation of the Fourier transform of ##f## was OK.

Now our integral is equal to the convolution (with the ##2\pi## scale factor) evaluated at ##u = 0##:
$$I = \frac{1}{2\pi} \int_{-\infty}^{\infty} \hat{f}(v) \hat{g}(-v) dv$$
Since ##\hat{g}## is even, this is equivalent to
$$I = \frac{1}{2\pi} \int_{-\infty}^{\infty} \hat{f}(v) \hat{g}(v) dv$$
Plugging in the results for ##\hat{f}## and ##\hat{g}##, we have
\begin{align} I &= \frac{1}{2\pi} \int_{-1}^{1} \frac{1}{a+iu} (\pi) du \\ &= \frac{1}{2} \int_{-1}^{1} \frac{1}{a+iu} du \\ &= \frac{1}{2} \int_{-1}^{1} \frac{a - iu}{a^2 + u^2} du \\ &= \frac{1}{2} \int_{-1}^{1} \frac{a}{a^2 + u^2} du \end{align}
which Wolfram tells me is equal to ##\tan^{-1}(1/a)##.

Staff Emeritus