Integrating Trigonometric Functions with Exponential Factors

Saitama
Messages
4,244
Reaction score
93

Homework Statement


\int_{0}^{2\pi} \frac{dx}{1+e^{\sin x}}

Homework Equations


The Attempt at a Solution


Let ##I=\int_{0}^{2\pi} \frac{dx}{1+e^{\sin x}}##

Since ##\int_{a}^{b}f(x) dx=\int_{a}^{b} f(a+b-x)dx##
Hence,
I=\int_{0}^{2\pi} \frac{dx}{1+e^{-\sin x}}=\int_{0}^{2\pi} \frac{e^{\sin x}dx}{1+e^{\sin x}}

2I=\int_{0}^{2 \pi}dx
I=\pi

This is the right answer but when I try it with the following method it turns out to be zero.

Let ##\sin x=t## or ##\cos xdx=dt##. Multiply the numerator and denominator by ##\cos x## & ##\cos x=\sqrt{1-t^2}##
The integral transforms to
I=\int_{0}^{0} \frac{dt}{\sqrt{1-t^2} (1+e^t)}
Both the upper and lower limits are zero. The value of I should be zero. What have I done wrong? :confused:

Any help is appreciated. Thanks!
 
Physics news on Phys.org
Yo Naruto fan :)
Last year i was confused with the same problem... when a trigonometric function is applied to 0 or 2∏, we get the same result... As trigonometric functions are periodic. You can draw a graph and u can see that the area under the curve is not 0. This implies that you can not substitute a trigonometric function like "sin x" with a variable like "t" when the difference between the upper and lower limits is greater than ∏/2... It doesn't appear wrong... but it is something like to prove LHS=RHS by multiplying both sides of an equation with zero...!
Hope this helped!
 
Hello there,

Be careful with:

\cos x = \sqrt{1- \sin^{2} x}​

In particular, for 0 \le x \le 2\,\pi:

<br /> \cos x = \left \{ \begin{array}{ll}<br /> \sqrt{1- \sin^{2} x} &amp; 0 \le x \le \pi/2\\<br /> -\sqrt{1- \sin^{2} x} &amp; \pi/2 &lt; x \le 3\,\pi/2 \\<br /> \sqrt{1- \sin^{2} x} &amp; 3\,\pi/2 &lt; x \le 2\,\pi<br /> \end{array}\right .​

In your case, split the integral in 3 cases, and go ahead.
 
Pranav-Arora said:

Homework Statement


\int_{0}^{2\pi} \frac{dx}{1+e^{\sin x}}


Homework Equations





The Attempt at a Solution


Let ##I=\int_{0}^{2\pi} \frac{dx}{1+e^{\sin x}}##

Since ##\int_{a}^{b}f(x) dx=\int_{a}^{b} f(a+b-x)dx##
Hence,
I=\int_{0}^{2\pi} \frac{dx}{1+e^{-\sin x}}=\int_{0}^{2\pi} \frac{e^{\sin x}dx}{1+e^{\sin x}}

2I=\int_{0}^{2 \pi}dx
I=\pi

This is the right answer but when I try it with the following method it turns out to be zero.

Let ##\sin x=t## or ##\cos xdx=dt##. Multiply the numerator and denominator by ##\cos x## & ##\cos x=\sqrt{1-t^2}##
The integral transforms to
I=\int_{0}^{0} \frac{dt}{\sqrt{1-t^2} (1+e^t)}
Both the upper and lower limits are zero. The value of I should be zero. What have I done wrong? :confused:

Any help is appreciated. Thanks!

JFGobin has provided the correct explanation, but you should note that once you split the integral up, you don't really save any work - you basically need to do the same thing you did the first time to get the result (plus at one point you need to evaluate ##\displaystyle \int_{-1}^{1}\frac{1}{\sqrt{1-t^2}}dt##, which is easy, but still extra work). You do get the same answer though (I checked).
 
Curious3141 said:
JFGobin has provided the correct explanation, but you should note that once you split the integral up, you don't really save any work - you basically need to do the same thing you did the first time to get the result (plus at one point you need to evaluate ##\displaystyle \int_{-1}^{1}\frac{1}{\sqrt{1-t^2}}dt##, which is easy, but still extra work). You do get the same answer though (I checked).

Thank you Curious and jfgobin! :smile:

I tried your advice but still cannot reach the final answer.
The given integral can be separated into three integrals.
I=\int_{0}^{\pi/2} \frac{\cos x}{\sqrt{1-\sin^2x}(1+e^{\sin x})}dx-\int_{\pi/2}^{3\pi/2} \frac{\cos x}{\sqrt{1-\sin^2x}(1+e^{\sin x})}dx+\int_{3\pi/2}^{2\pi} \frac{\cos x}{\sqrt{1-\sin^2x}(1+e^{\sin x})}dx
Using the substitution ##\sin x=t##.
I=\int_{0}^{1} \frac{dt}{\sqrt{1-t^2}(1+e^t)}+\int_{-1}^{1} \frac{dt}{\sqrt{1-t^2}(1+e^t)}+\int_{-1}^{0} \frac{dt}{\sqrt{1-t^2}(1+e^t)}
I=I_1+I_2+I_3

I did a change of variable in ##I_3##, I substituted ##t=-x## or ##dt=-dx##. The integral ##I_3## transforms to
I_3=\int_{1}^{0} \frac{-dx}{\sqrt{1-x^2}(1+e^{-x})}
which is equivalent to
I_3=\int_{0}^{1} \frac{e^tdt}{\sqrt{1-t^2}(1+e^{t})}

Now I can add ##I_3## and ##I_1##. I end up with this:
I=\int_{0}^{1} \frac{dt}{\sqrt{1-t^2}}+\int_{-1}^{1} \frac{dt}{\sqrt{1-t^2}(1+e^t)}
But my expression doesn't include the integral mentioned by Curious3141. :confused:
 
Pranav-Arora said:
Thank you Curious and jfgobin! :smile:

I tried your advice but still cannot reach the final answer.
The given integral can be separated into three integrals.
I=\int_{0}^{\pi/2} \frac{\cos x}{\sqrt{1-\sin^2x}(1+e^{\sin x})}dx-\int_{\pi/2}^{3\pi/2} \frac{\cos x}{\sqrt{1-\sin^2x}(1+e^{\sin x})}dx+\int_{3\pi/2}^{2\pi} \frac{\cos x}{\sqrt{1-\sin^2x}(1+e^{\sin x})}dx
Using the substitution ##\sin x=t##.
I=\int_{0}^{1} \frac{dt}{\sqrt{1-t^2}(1+e^t)}+\int_{-1}^{1} \frac{dt}{\sqrt{1-t^2}(1+e^t)}+\int_{-1}^{0} \frac{dt}{\sqrt{1-t^2}(1+e^t)}
I=I_1+I_2+I_3

I did a change of variable in ##I_3##, I substituted ##t=-x## or ##dt=-dx##. The integral ##I_3## transforms to
I_3=\int_{1}^{0} \frac{-dx}{\sqrt{1-x^2}(1+e^{-x})}
which is equivalent to
I_3=\int_{0}^{1} \frac{e^tdt}{\sqrt{1-t^2}(1+e^{t})}

Now I can add ##I_3## and ##I_1##. I end up with this:
I=\int_{0}^{1} \frac{dt}{\sqrt{1-t^2}}+\int_{-1}^{1} \frac{dt}{\sqrt{1-t^2}(1+e^t)}
But my expression doesn't include the integral mentioned by Curious3141. :confused:

##I_1+I_3=I_2##. So if ##I_1+I_3=\int_{0}^{1} \frac{dt}{\sqrt{1-t^2}}## then ##I=2\int_{0}^{1} \frac{dt}{\sqrt{1-t^2}}=\int_{-1}^{1} \frac{dt}{\sqrt{1-t^2}}## (because the integral is symmetric in t).
 
Dick said:
##I_1+I_3=I_2##. So if ##I_1+I_3=\int_{0}^{1} \frac{dt}{\sqrt{1-t^2}}## then ##I=2\int_{0}^{1} \frac{dt}{\sqrt{1-t^2}}=\int_{-1}^{1} \frac{dt}{\sqrt{1-t^2}}## (because the integral is symmetric in t).

How do you get a factor of 2? :confused:

I_1=\int_0^1 \frac{dt}{\sqrt{1-t^2}(1+e^t)}
I_3=\int_0^1 \frac{e^t dt}{\sqrt{1-t^2}(1+e^t)}

I_1+I_3=\int_0^1 \frac{dt}{\sqrt{1-t^2}}

How do you get ##I_1+I_3=I_2##?
 
Pranav-Arora said:
How do you get ##I_1+I_3=I_2##?

Look back at the expressions you started with for I1, I2 and I3. I3 integrates ##\frac{dt}{\sqrt{1-t^2}(1+e^t)}## from -1 to 0, I1 integrates from 0 to 1. Put them together and it's the same as integrating -1 to 1. Which is I2.
 
Dick said:
Look back at the expressions you started with for I1, I2 and I3. I3 integrates ##\frac{dt}{\sqrt{1-t^2}(1+e^t)}## from -1 to 0, I1 integrates from 0 to 1. Put them together and it's the same as integrating -1 to 1. Which is I2.

Silly me. :redface:

Thanks a lot, Dick! :smile:
 
Back
Top