MHB How Do You Solve the Integral of ln|a+b*sin(x)| from 0 to 2π?

  • Thread starter Thread starter Saitama
  • Start date Start date
  • Tags Tags
    Integral
Saitama
Messages
4,244
Reaction score
93
I am trying to evaluate the following integral:
$$\int_0^{2\pi} \ln|a+b\sin x|\,dx$$
where $0<a<b$.

Source: homework - Find the value of the integral $\int_0^{2\pi}\ln|a+b\sin x|dx$ where $0\lt a\lt b$ - Mathematics Stack Exchange

Attempt:
Consider
$$I(a)=\int_0^{2\pi} \ln|a+b\sin x|\,dx$$
It can be shown that:
$$I(a)=2\int_0^{\pi/2} \ln|a^2-b^2\sin^2x|\,dx$$
Differentiate both sides wrt $a$ to get:
$$\frac{dI}{da}=4a\int_0^{\pi/2}\frac{dx}{a^2-b^2\sin^2x}$$
Next, I rewrite the denominator as:
$$a^2-b^2\sin^2x=\frac{a^2+(a^2-b^2)\tan^2x}{\sec^2x}$$
Using the substitution $\tan x=t$, I obtain the following definite integral:
$$\frac{dI}{da}=4a\int_0^{\infty} \frac{dt}{a^2+(a^2-b^2)t^2}$$
$$\Rightarrow \frac{dI}{da}=\frac{2\pi}{\sqrt{a^2-b^2}}$$
This is where I am stuck. I don't find the result correct because as per the question, $b>a$ due to which $\sqrt{a^2-b^2}$ doesn't make sense. :confused:

Any help is appreciated. Thanks!

EDIT: I thought about it some more and I think I see the error. I found an error at this step:
$$I(a)=2\int_0^{\pi/2} \ln|a^2-b^2\sin^2x|\,dx$$
I cannot simply differentiate the above because of the modulus symbol. $|a^2-b^2\sin^2x|=a^2-b^2\sin^2x$ only if $sin(x)<=a/b$, hence,
$$I(a)=2\left(\int_0^{a/b}\ln(a^2-b^2\sin^2x)\,dx+\int_{a/b}^{\pi/2} \ln(b^2\sin^2x-a^2)\,dx\right)$$
If I differentiate the above, I get:
$$\frac{dI}{da}=2\left(\int_0^{a/b}\frac{2a}{a^2-b^2\sin^2x}\,dx+\int_{a/b}^{\pi/2} \frac{-2a}{b^2\sin^2x-a^2}\,dx\right)$$
which is the same integral as before. :confused:
 
Last edited:
Physics news on Phys.org
We are given

[math] I= \int_0^{2 \pi} \ln \left \vert a+b \sin x \right \vert dx [/math].

The reason your evaluation of the integral was incorrect is because there are two discontinuities on [math] [0, 2 \pi] [/math], at [math] x= \pi + \arcsin(a/b) [/math] and [math] 2 \pi - \arcsin(a/b) [/math]. Therefore, we must split the integral at these points. Also, the absolute value of [math] a+b \sin x [/math] on [math] [0, \pi + \arcsin(a/b)] [/math] and [math] [2 \pi - \arcsin(a/b), 2 \pi] [/math] is just [math] a+b \sin x [/math], while on [math] [\pi + \arcsin(a/b), 2 \pi - \arcsin(a/b)] [/math], it is [math] -a-b \sin x [/math].
Putting these together and setting [math] \pi + \arcsin(a/b)=c [/math] and [math] 2 \pi - \arcsin(a/b)=d [/math], we have

[math] I= \int_0^{c} \ln (a+b \sin x) dx + \int_c^{d} \ln (-a-b \sin x) dx +\int_d^{2 \pi} \ln (a+b \sin x) dx [/math].

Considering I to be a function of a and differentiating under the integral sign, we have

[math] \frac{dI}{da} = \int_0^{c} \frac{1}{a+b \sin x} dx +\int_c^{d} \frac{-1}{-a- b \sin x} dx +\int_d^{2 \pi} \frac{1}{a+b \sin x} dx [/math].

Using the substitution [math] z=\tan \frac{x}{2} [/math] and completing the square, the integrand becomes

[math] \frac{2}{a} \frac{1}{(z+\frac{b}{a})^2+(1-\frac{b^2}{a^2})} [/math].

Integrating (without bounds for the moment), we have

[math] \frac{2}{\sqrt{a^2-b^2}} \arctan \frac{a \tan \frac{x}{2} +b}{\sqrt{a^2-b^2}} +C[/math].

But since [math] a < b [/math], this quantity is imaginary! All is not lost, however. We have

[math] \operatorname{arctanh} z = \frac{1}{i} \arctan iz [/math].

Using this relation, the integral becomes

[math] \frac{2}{\sqrt{b^2-a^2}} \operatorname{arctanh} \frac{a \tan \frac{x}{2} +b}{\sqrt{b^2-a^2}} +C[/math],

which is real.
Evaluating between the three sets of bounds, we have

[math] \frac{dI}{da} = \frac{2}{\sqrt{b^2-a^2}} \left ( \operatorname{arctanh} \frac{b}{\sqrt{b^2-a^2}} -\operatorname{arctanh} \frac{b}{\sqrt{b^2-a^2}} \right ) =0 [/math].

We would appear to be stuck. However, all this implies is that I is not a function of a, as we had previously assumed. Therefore, letting a approach 0 in the original integral gives

[math] I= \int_0^{2 \pi} \ln \left \vert b \sin x \right \vert dx [/math].

Splitting up the argument of the ln, and using the fact that the integral of sine on [math] [0, 2 \pi] [/math] is four times the integral on [math] [0, \frac{\pi}{2}] [/math], we have

[math] I= 2 \pi \ln b + 4 \int_0^{\frac{\pi}{2}} \ln \sin x dx [/math].

Taking [math] \sin x = 2 \sin \frac{x}{2} \cos \frac{x}{2} [/math] and splitting up the logarithmic terms, the second term becomes

[math] 2 \pi \ln 2 + 4 \int_0^{\frac{\pi}{2}} \ln \sin \frac{x}{2} dx + 4 \int_0^{\frac{\pi}{2}} \ln \cos \frac{x}{2} dx [/math].

Substituting [math] u= \frac{x}{2} [/math], the integrals become

[math] 8 \int_0^{\frac{\pi}{4}} \ln \sin u \ du + 8 \int_0^{\frac{\pi}{4}} \ln \cos u \ du [/math].

Substituting [math] u= \frac{\pi}{2} –t [/math] into the cosine integral, it becomes

[math] \int_{\frac{\pi}{4}}^{\frac{\pi}{2}} \ln \sin t \ dt [/math].

Therefore,

[math] 4 \int_0^{\frac{\pi}{2}} \ln \sin x dx= 2\pi \ln 2 + 8 \int_0^{\frac{\pi}{2}} \ln \sin x dx [/math].

Cancelling, and remembering the fact that the integral of sine over a period is equal to four times its integral over a quarter-period, we have

[math] 4 \int_0^{\frac{\pi}{2}} \ln \sin x dx=\int_0^{2 \pi} \ln \sin x dx = -2 \pi \ln 2 [/math].

Substituting into the equation for I and combining logarithmic terms, we obtain (finally)

[math] I= 2 \pi \ln \frac{b}{2} [/math].
 
Last edited:
Back
Top