Solving $\int_0^{\pi/2}x\cot x\,\mathrm{d}x$ while running into a $0\times\infty=0$ problem

114 Views Asked by At

While i have been trying to solve the integral $ \int_0^{\pi/2} x\cot x \, \mathrm{d}x $ i have noticed that by trying integrating by parts using $u = x$ and $\mathrm{d}v = \cot x \, \mathrm{d}x$, i get that:

$$ \int_0^{\pi/2} x\cot x \, \mathrm{d}x = x\ln\sin x\Big|_0^{\pi/2} - \int_0^{\pi/2} \ln\sin x\,\mathrm{d}x $$

Plugging the first integral in Wolfram Alpha and after that the resulting integral in the right hand side i noticed that they have the same value! So the evaluation of $u\cdot v$ from $0$ to $\pi/2$ must be $0$, but how is this possible? I mean $\sin 0= 0$ and $\ln 0= -\infty$, so, how is that the term $x\sin x\Big|_0^{\pi/2}$ can be $0$? Or how am i wrong?

Ps: I am trying to integrate by parts first because i am trying to solve the integral by differentiation under the integral sign, if you have any suggestions for this i would also appreciate it!

2

There are 2 best solutions below

1
On BEST ANSWER

For your main concern, it's been in the comments but I'll copy it again into the answer, we have

$$\lim_{x\to 0^+}x\ln(\sin x)=0$$

by L'Hospital's rule, for example. Therefore it does hold that $$x\ln(\sin x)\vert_{0}^{\pi/2}=0-0=0$$


I believe there are sources online that shows you how to do this integral (maybe not MSE, but somewhere), but I will try to answer it using Leibniz's rule as you specifically required. Consider for $0\le a\le 1$, $$I(a)=\int_0^{\frac{\pi}{2}}\arctan\left(a\tan x\right)\cdot \cot x\,dx$$ Then \begin{align*} I'(a)&=\int_0^{\frac{\pi}{2}}\frac{\tan x}{a^2\tan^2 x+1}\cdot \cot x\,dx\\ &=\int_0^{\frac{\pi}{2}}\frac{1}{a^2\tan^2 x+1}\,dx\quad\left[\text{let}\ t=\tan x\right]\\ &=\int_0^\infty\frac{1}{a^2t^2+1}\cdot\frac{dt}{t^2+1}\quad\left[\text{just ask Wolfram}\right]\\ &=\frac{\pi}{2\left(a+1\right)} \end{align*} Thus we conclude that $I(a)=\frac{\pi}{2}\ln\left(a+1\right)+C$ where $I(0)=0$, so that $$I(1)=\int_0^{\frac{\pi}{2}}x\cot x\,dx=\frac{\pi}{2}\ln(2)$$ as desired.

0
On

$$I=\int_{0}^{\pi/2} x \cot x dx$$ Integrate by parts $$I=x \ln \sin x-|_{0}^{\pi/2}-\int_{0}^{\pi/2} \ln \sin x$$ Using $\lim_{x \to 0}$ by L'Hospitalof the first part, we get $$I=-\int_{0}^{\pi/2}\sin x dx~~~~(1)$$ Use the property $\int_{0}^{a} f(x) dx= \int_{0}^{a} f(a-x) dx$ Get $$I=-\int_{0}^{\pi/2}\ln \cos x dx~~~~(2)$$ add (1) and (2), then $$2I=-\int_{0}^{\pi/2} \ln \sin x \cos x dx=\int_{0}^{\pi/2} \ln \sin 2x dx -\frac{\pi}{2}\ln 2~~~~(3)$$ Take $2x=t$, then $$2I=-\frac{1}{2}\int_{0}^{\pi} \ln \sin t dt+\frac{\pi}{2}\ln 2~~~~(4)$$ Use the property: $\int_{0}^{a} f(x) dx=\int_{0}^{a/2}[f(x)+f(a-x)] dx,$ then $$2I=-\int_{0}^{\pi/2} \ln \sin t dt +\frac{\pi}{2}\ln 2~~~(5)$$ Using (1), we get $$2I=I+\frac{\pi}{2}\ln 2 \implies I=\frac{\pi}{2}\ln 2$$