## anonymous one year ago Kinda tricky integral: $\int_{-\infty}^\infty \frac{\cos x}{(x^2+1)(1+e^x)}\,dx$

1. anonymous

I've got some hints in mind, but I'm debating whether or not they give too much away :)

2. myininaya

*

3. thomas5267

I don't know but I kind of feel like it has something to do with Gaussian integral.

4. anonymous

It's related in that the result also contains $$\pi$$, but beyond that I'm not sure... It'd be fascinating to see a derivation of this integral using the Guassian.

5. thomas5267

Convert to polar coordinate analogous to how you would evaluate Gaussian integral?

6. thomas5267

f(x)=\frac{\cos x}{(x^2+1)(1+e^x)}\\ \begin{align*} f(x)f(y)&=\frac{\cos x}{(x^2+1)(1+e^x)}\frac{\cos y}{(y^2+1)(1+e^y)}\\ &=\frac{\cos(x)\cos(y)}{\left(r^2+x^2y^2+1)(1+e^x+e^y+e^{x+y}\right)},\,r^2=x^2+y^2 \end{align*} Aesthetically pleasing, probably of no use.

7. anonymous

Alright, here's my first hint: Notice that $$\dfrac{\cos x}{x^2+1}$$ is even.

8. anonymous

Hint (1.a): $$y=-x$$

9. ganeshie8

Picking up on that hint : $I=\int_{-\infty}^\infty \frac{\cos x}{(x^2+1)(1+e^x)}\,dx$ sub $$y=-x$$ and get $I=\int_{-\infty}^\infty \frac{e^x \cos x}{(x^2+1)(1+e^x)}\,dx$ Add them and get $2I =\int_{-\infty}^\infty \frac{\cos x}{x^2+1}\,dx$

10. ganeshie8

since the integrand is even, $I =\int_{0}^\infty \frac{\cos x}{x^2+1}\,dx$

11. ganeshie8

please do not give further hints, I think i got this :)

12. anonymous

So far so good! I had a lot of trouble making use of the "hidden" fact that $\frac{1}{1+e^x}+\frac{1}{1+e^{-x}}=1$ The rest of the solution can go any of several ways, I think. I'd love to see what you come up with.

13. ganeshie8

we may try DUT $F(y) = \int_{0}^\infty \frac{\cos(xy)}{x^2+1}\,dx$ $\implies F''(y) = -\int_{0}^\infty \frac{x^2\cos(xy)}{x^2+1}\,dx$ $\implies -F''(y) + F(y) = \int_{0}^\infty \cos(xy)\,dx$

14. ganeshie8

scratch that, doesn't converge

15. anonymous

Oooh, a related problem: $\int_0^{\pi/2} \cos(\tan x)\,dx$(which is equivalent to the integral at hand, which you can see if you set $$t=\tan x$$)

16. anonymous

@ganeshie8 I'm not at all surprised MSE has this one covered, but let's not spoil it for the rest. Based off of one of the answers I skimmed over, you seem to be on the right track with that ODE approach.

17. ganeshie8

I think its mostly done : $F''(y) - F(y) = 0 \implies F(y) = C_1e^y + C_2e^{-y}$ finding $$C_1$$ and $$C_2$$ by choosing appropriate initial conditions should be a piece of cake

18. IrishBoy123

|dw:1442566006271:dw| do you not have to subtract them as the integration order needs to be reversed with the sub?

19. ganeshie8

differential also changes sign so that fixes the bounds..

20. IrishBoy123

duh :-)

21. thomas5267

The answer is $$\dfrac{\pi}{e}$$? Read something extremely similar to this on Wikipedia and want to confirm the answer before trying.

22. thomas5267

Did I missed by a factor of 2?

23. anonymous

Yep, the value of the integral is $$\dfrac{\pi}{2e}$$, but it's not the answer that's important, it's how to get it :)

24. thomas5267

Wikipedia: Residue theorem. I don't know how Wikipedia did this but the answer is basically there. I don't even know line integral let alone the complex version of it.

25. thomas5267

26. anonymous

Right, contour integration is always an option, you just have to choose the right contour. My approach utilized the Laplace transform. First you parameterize the integral as follows. $I(a)=\int_{-\infty}^\infty \frac{\cos ax}{(x^2+1)(1+e^x)}\,dx$ The change of variables/exponential identity reduces this to $I(a)=\int_0^\infty \frac{\cos ax}{x^2+1}\,dx$ Take the Laplace transform: $\mathcal{L}_s\{ I(a)\}=\int_0^\infty \left(\int_0^\infty \frac{\cos ax}{x^2+1}\,dx\right)e^{-as}\,da$ and some rearranging gives $\mathcal{L}_s\{ I(a)\}=\int_0^\infty \left(\int_0^\infty e^{-as}\cos ax\,da\right)\frac{dx}{x^2+1}$ where the inner integral is just the Laplace transform of $$\cos ax$$, i.e. $$\mathcal{L}_s\{\cos ax\}=\dfrac{s}{s^2+x^2}$$. $\mathcal{L}_s\{ I(a)\}=\int_0^\infty \frac{dx}{(x^2+1)(x^2+s^2)}$ Partial fractions: $\frac{1}{(x^2+1)(x^2+s^2)}=\frac{1}{s^2-1}\left(\frac{1}{x^2+1}-\frac{1}{x^2+s^2}\right)$ And now we can integrate: \begin{align*}\mathcal{L}_s\{ I(a)\}&=\frac{1}{s^2-1}\int_0^\infty \left(\frac{1}{x^2+1}-\frac{1}{x^2+s^2}\right)\,dx\\[1ex] &=\frac{1}{s^2-1}\left(\frac{\pi}{2}-\frac{\pi}{2s}\right)\\[1ex] &=\frac{\pi}{2}\left(\frac{1}{s^2-1}-\frac{1}{s(s^2-1)}\right)\\[1ex] &=\frac{\pi}{2}\left(\frac{1}{s^2-1}+\frac{1}{s}-\frac{s}{s^2-1}\right) \end{align*} And finally, take the inverse transform. \begin{align*}\mathcal{L}_s\{ I(a)\}&=\frac{\pi}{2}\left(\frac{1}{s^2-1}+\frac{1}{s}-\frac{s}{s^2-1}\right)\\[1ex] I(a)&=\mathcal{L}_a^{-1}\{\cdots\}\\[1ex] &=\frac{\pi}{2}\left(\sinh a+1-\cosh a \right) \end{align*} Let $$a=1$$ and we're done.

27. IrishBoy123

dark magic