# how to compute this definite integral [duplicate]

how to compute $\displaystyle I=\int\limits_{0}^{\pi/2}\frac{x}{\tan x}\,dx$

i made $f(x)=\frac{x}{\tan x}$ and then i see that

\begin{align} \lim_{x\to0}f(x)&=\lim_{x\to0}\frac{x}{\tan x}\\ &=\lim_{x\to0}\frac{x\cos x}{\sin x}\\ &=\lim_{x\to0}\frac{\cos x}{\frac{\sin x}{x}}\\ &=\frac{\lim\limits_{x\to0}\cos x}{\lim\limits_{x\to0}\frac{\sin x}{x}}=1\\ \lim_{x\to\pi/2}f(x)&=\lim_{x\to\pi/2}\frac{x}{\tan x}=0 \end{align}

we have that $f(x)$ is decreasing into $(0,\pi/2)$ and $f(x)\in(0,1)$ for $x\in(0,\pi/2)$, then i think that

$$0<\displaystyle \int\limits_{0}^{\pi/2}\frac{xdx}{\tan x}<\frac{\pi}{2}$$

i think the primitive can not be expressed in terms of elementary functions, then i think that other method like residue theorem or power series would be used, but i dont know how to use any of these, how i compute this integral?

## marked as duplicate by Hans Lundmark, Nosrati, erfink, Namaste, Siong Thye GohSep 22 '17 at 0:13

• There is no elementary antiderivative, so taylor series would be your best bet. – SalmonKiller Jun 10 '15 at 22:09
• Wolfram Alpha says that the answer is $\frac{\pi}{2} \log 2$ – Crostul Jun 10 '15 at 22:19

Integration by parts gives

$$\int_0^{\pi/2}\frac{x}{\tan x}dx=\left. x\log (\sin x)\right|_0^{\pi/2}-\int_0^{\pi/2}\log(\sin x)dx=\frac{\pi}{2}\log 2$$

• I knew that there had to be some simple and elegant way that I missed. :-$)$ – Lucian Jun 11 '15 at 1:56
• @Lucian Thanks. Your solutions are always very creative! – Mark Viola Jun 11 '15 at 2:10

Define $I(b)$ as:
$I(b)=\int_0^{\pi/2}{\frac{\tan^{-1}(b\tan(x))}{\tan(x)}dx}$
It is not hard to show that $f(x,b) = \frac{\tan^{-1}(b\tan(x))}{\tan(x)}$ and its derivative $f'(x)$ are both continuous in $x$ and $b$. Then
\begin{align*} I'(b) &= \frac{d}{dx}\int_0^{\pi/2}{\frac{\tan^{-1}(b\tan(x))}{\tan(x)}dx} \\ &= \int_0^{\pi/2}{\frac{\partial}{\partial x}\frac{\tan^{-1}(b\tan(x))}{\tan(x)}dx} \\ &= \int_0^{\pi/2}{\frac{dx}{(b\tan(x))^2+1}} \\ &= \frac{\pi}{2(b+1)} \end{align*}

Integrating with respect to $b$ leads to: $I(b) = \frac{\pi}{2}\log(b+1)$ So the original integral is:
$\int_0^{\pi/2}{\frac{xdx}{tan(x)}} = \frac{\pi}{2}\log(2)$

Ref. "INTEGRATION: THE FEYNMAN WAY" from one of the MIT open course web sites

• How did you evaluate $\int_0^{\pi/2}\frac{1}{1+b^2\tan^2 x}dx$ so readily? While the integrand has a closed form anti-derivative, it requires a bit of work (e.g., Weirstrauss substitution). Just curious. – Mark Viola Jun 10 '15 at 23:24
• @Dr. MV: should be easy to evaluate using $\int{\frac{dx}{a+b\tan^2(x)}}=\frac{1}{a-b}\left[ x - \sqrt{\frac{b}{a}}\arctan\left(\sqrt{\frac{b}{a}} \tan(x) \right) \right]$ – Ali Jun 11 '15 at 4:23
• Yes, it isn't difficult. But, it takes a bit of effort ... that is all I meant. I like the "Feynman" trick by the way. Here, there is a more direct way forward. – Mark Viola Jun 11 '15 at 5:48

Hint: Letting $x=\tan t$ and integrating by parts with regard to $~\dfrac{\arctan t}{t^2+1}~dt=d\bigg(\dfrac{\arctan^2t}2\bigg)$, then doing the Cauchy product of $\dfrac{\arctan t}t$ with itself after expanding $\arctan t$ into its Taylor series and dividing each term by t, we switch the order of summation and integration only to obtain an infinite series which is immediately recognized as the Cauchy product of the Mercator series for $\ln2$ and the Leibniz series for $\dfrac\pi4$.

• I would think that this is obvious. – marty cohen Jun 10 '15 at 22:53