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

In summary: So I guess I have made some mistake in the sign somewhere. I get a similar result when I use the lower loop (instead of the upper one) in the sketch above. (I switched the signs for the contributions from the two small sections, but the result is still off.)In summary, Wolfram Alpha was not able to solve the given integral, but it can be solved using a combination of Leibniz's rule and complex analysis.
  • #1
Office_Shredder
Staff Emeritus
Science Advisor
Gold Member
5,606
1,527
a.) Poor Wolfram Alpha got asked to calculate the following integral
[tex] \int_{0}^{\infty} e^{-ax} \frac{\sin(x)}{x} dx [/tex]
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.
 
Mathematics news on Phys.org
  • #2
Office_Shredder said:
a.) Poor Wolfram Alpha got asked to calculate the following integral
[tex] \int_{0}^{\infty} e^{-ax} \frac{\sin(x)}{x} dx [/tex]
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.
 
  • #3
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:
  • #4
How about if we start by letting:

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

And it would be nice if we could compute [itex]\frac{dI}{da}[/itex] as that would rid the denominator of [itex]x[/itex]. Not sure if that integrand satisfies Leibniz's criteria for differentiating under the integral sign though.
 
  • #5
We have that [tex]\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)[/tex]

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

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

Now applying Leibniz's rule, we get:
[tex]\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}[/tex]

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

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

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


I hope I have not overlooked something!

EDIT:
I realized that uniform convergence holds only on [itex]0 < a < ∞[/itex] so the equation [itex]I'(a) = -\frac{1}{a^2+1} [/itex] is guaranteed only for [itex] a > 0 [/itex]. I think this can be patched by showing that [itex]I(a)[/itex] is continuous at 0.
 
Last edited:
  • Like
Likes 1 person
  • #6
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.

attachment.php?attachmentid=63089&stc=1&d=1382140283.png


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

  • pathes.png
    pathes.png
    2.3 KB · Views: 606
  • Like
Likes 1 person
  • #7
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 [itex]f(z)/z[/itex] (as radius goes to zero) is [itex]\theta i f(0)[/itex]. You forgot the i.

Did it quick but looks like it ends up being:

[tex]\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)[/tex]

which then gives us the requisite [itex]\arctan(1/a).[/itex]
 
Last edited:
  • #8
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.
 
  • #9
mfb said:
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 [itex]z=re^{i\theta}[/itex] on the top path and [itex]z=re^{-i\theta}[/itex] on the bottom path with [itex]\theta=\arctan(1/a)[/itex]

For the top, I get:

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

and the bottom:

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

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

[tex]\int_0^{\infty} \frac{e^{re^{i\theta}(i-a)}}{r}dr-\int_0^{\infty} \frac{e^{-re^{-i\theta}(i+a)}}{r}dr[/tex]

and

[tex]e^{r e^{i\theta(i-a)}}-e^{-r e^{-i\theta(a+i)}}=0[/tex]

for [itex]\theta=\arctan(1/a)[/itex].
 
  • #10
Okay. Good to see that the "direct" approach is possible.
 
  • #11
jackmell said:
Did it quick but looks like it ends up being:

[tex]\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)[/tex]

which then gives us the requisite [itex]\arctan(1/a).[/itex]

I probably should have written that as:

[tex]\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)[/tex]

and [itex]f(r,\theta)-g(r,\theta)=0[/itex] for [itex]\theta=\arctan(1/a)[/itex].
 
  • #12
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.
 
  • #13
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.
 
  • #14
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.
 
  • #15
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.
 
  • #16
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:
  • #17
Office_Shredder said:
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.
 
  • #18
I'll try to fix the scale factors later today if I have time.
 
  • #19
I see, I missed the fact that they end up looking exactly the same.
 
  • #20
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)##.
 
  • #21
Nice! I first came upon this integral trying to solve the Fourier transform of a different product of functions (I can't even remember what it was now) by using the convolution theorem, your solution makes me wonder if I did it in a very roundabout way now.
 

1. What is integration in the context of Challenge 4?

Integration in Challenge 4 refers to the process of combining different systems or components to work together seamlessly and efficiently.

2. Why is integration important?

Integration is important because it allows for the efficient flow of data and communication between different systems, reducing the need for manual input and streamlining processes.

3. What are some challenges that may arise during integration?

Some challenges that may arise during integration include compatibility issues between systems, data discrepancies, and security concerns.

4. How can these challenges be addressed?

These challenges can be addressed by conducting thorough testing, ensuring compatibility between systems, and implementing data validation and security measures.

5. What are some potential benefits of successful integration?

Successful integration can lead to improved efficiency, reduced costs, and enhanced data accuracy and accessibility.

Similar threads

Replies
7
Views
2K
Replies
6
Views
2K
  • Calculus and Beyond Homework Help
Replies
10
Views
1K
Replies
3
Views
530
  • Calculus and Beyond Homework Help
Replies
3
Views
2K
  • Calculus and Beyond Homework Help
Replies
17
Views
2K
  • General Math
Replies
1
Views
943
  • Calculus
Replies
5
Views
1K
  • Math Proof Training and Practice
3
Replies
93
Views
10K
  • General Math
4
Replies
125
Views
16K
Back
Top