Fun Integral #2

Welcome to the second article in our integral series! We will be evaluating a log-sine integral using differentiation under the integral sign, or Feynman’s trick if you prefer.

\displaystyle I(a)=\int_0^{\pi/2}\ln\left(1+a\sin^2(x)\right)\,dx

Now, differentiate both sides with respect to a,

\displaystyle I'(a)=\int_0^{\pi/2}\frac{\sin^2(x)}{1+a\sin^2(x)}\,dx=\int_0^{\pi/2} \frac{1}{a+\csc^2(x)}\,dx

Now, substitute u=\cot(x)

\displaystyle I'(a)=-\int_{\infty}^{0}\frac{1}{a+1+u^2}\left(\frac{1}{u^2+1}\right)\,du=\int_{0}^{\infty}\frac{1}{a+1+u^2}\left(\frac{1}{u^2+1}\right)\,du

Where we used the trigonometric identity 1+\cot^2(x)=\csc^2(x). Using partial fraction expansion,

\displaystyle I'(a)=\frac{1}{a}\int_{0}^{\infty}\frac{1}{u^2+1}-\frac{1}{a+1+u^2}\,dx

It’s easy to recognize the first two as arctangent integrals. Indeed,

\displaystyle I'(a)=\frac{1}{a}\left(\frac{\pi}{2}-\frac{\pi}{2}\left(\frac{1}{\sqrt{a+1}}\right)\right)=\frac{\pi}{2a}\left(1-\frac{1}{\sqrt{a+1}}\right)

Remember that we want I(a), and not I'(a). That means that we have to solve this differential equation. Simple integration will do.

\displaystyle I(a)=\frac{\pi}{2}\int\frac{1}{a}\left(1-\frac{1}{\sqrt{a+1}}\right)\,da

Substituting u=\sqrt{a+1}, we find that

\displaystyle I(a)=\frac{\pi}{2}\int \frac{1}{u^2-1}\left(1-\frac{1}{u}\right)2u\,du=\pi\int\frac{1}{(u-1)(u+1)}\left(u-1)\right)\,du=\pi\int\frac{1}{1+u}\,du

Thus,

\displaystyle I(a)=\pi\ln\left(1+\sqrt{a+1}\right)+C

Since I(0)=0, we can deduce that C=-\pi\ln(2)

Arriving at our final beautiful result,

\begin{aligned} I(a) &=\pi\ln\left(1+\sqrt{a+1}\right)-\pi\ln(2) \\ &=\pi\ln\left(\frac{1+\sqrt{a+1}}{2}\right) \end{aligned}

Fun Integral #1

This will be the start of a new series, this blog’s first one. It will be dealing with interesting integrals; these will be classified as such for different reasons. For example, if I come across an integral which requires an uncommon creative method to solve it, the integral will probably feature in this series. Here is the first on in the series, not terribly difficult, but rather interesting.

\displaystyle I=\int_1^{\infty} \frac{\arctan(x)}{x^2}\,dx

It’s easy to make sure that the above integral converges. As for solving it, I encourage you, the reader, to attempt it before reading my solution. After all, this series is also aimed at teaching enthusiasts new methods that they might not have encountered before.

First substitute x=\tan(u). This serves the purpose of getting ride of that nasty inverse tangent in the numerator. We then have dx=\sec^2(u)\,du

\displaystyle I=\int_{\pi/4}^{\pi/2} \frac{\arctan\left(\tan(u)\right)}{\tan^2(u)}\sec^2(u)\,du=\int_{\pi/4}^{\pi/2}\frac{u}{\sin(u)}\,du=\int_{\pi/4}^{\pi/2}u\csc(u)\,du

We can now integrate by parts.

\displaystyle I=\left(-u\cot(u)\right)\Big|_{\pi/4}^{\pi/2}-\int_{\pi/4}^{\pi/2}-\cot(u)\,du=\frac{\pi}{4}+\int_{\pi/4}^{\pi/2}\cot(u)\,du

The last integral can be easily evaluated:

\displaystyle \int_{\pi/4}^{\pi/2}\frac{\cos(u)}{\sin(u)},du=\int_{\pi/4}^{\pi/2}\frac{d(\sin(u))}{\sin(u)}=\left(\ln(\left(\sin(u)\right)\right)\Big|_{\pi/4}^{\pi/2}=\ln\left(\sqrt{2}\right)

Thus our original integral is equal to

\displaystyle I=\frac{\pi}{4}+\ln\left(\sqrt{2}\right)