# What methods can be used to solve $\int_{0}^{\frac{\pi}{2}} \frac{x}{\tan(x)} \:dx$

I'm seeking methods to solve the following definite integral:

$$I = \int_{0}^{\frac{\pi}{2}} \frac{x}{\tan(x)} \:dx$$

The method I took was:

First make the substitution $$t = \tan(x)$$

$$I = \int_{0}^{\infty} \frac{\arctan(t)}{t\left(1 + t^2\right)} \:dt$$

Now, let

$$I\left(\omega\right) = \int_{0}^{\infty} \frac{\arctan(\omega t)}{t\left(1 + t^2\right)} \:dt$$

Thus,

\begin{align} \frac{dI}{d\omega} &= \int_{0}^{\infty} \frac{t}{t\left(1 + t^2\right)\left(1 + \omega^2t^2\right)} \:dt \\ &= \int_{0}^{\infty} \frac{1}{\left(1 + t^2\right)\left(1 + \omega^2t^2\right)} \\ &= \frac{1}{\omega^2 - 1} \int_{0}^{\infty}\left[\frac{\omega^2}{\left(1 + \omega^2t^2\right)} - \frac{1}{\left(1 + t^2\right)}\right]dt \\ &= \frac{1}{\omega^2 - 1} \left[\omega\arctan(\omega t) - \arctan(t) \right]_{0}^{\infty} \\ &= \frac{1}{\omega^2 - 1} \left[\omega\frac{\pi}{2} - \frac{\pi}{2}\right]\\ &= \frac{1}{\omega + 1}\frac{\pi}{2} \end{align}

Hence,

$$I(\omega) = \int \frac{1}{\omega + 1}\frac{\pi}{2}\:d\omega = \frac{\pi}{2}\ln|\omega + 1| + C$$

Setting $$\omega = 0$$ we find:

$$I(0) = C = \int_{0}^{\infty} \frac{\arctan(0 \cdot t)}{t\left(1 + t^2\right)}\:dt = 0$$

Thus,

$$I(\omega) = \frac{\pi}{2}\ln|\omega + 1|$$

And finally,

$$I(1) = \int_{0}^{\infty} \frac{\arctan(t)}{t\left(1 + t^2\right)} \:dt =\int_{0}^{\frac{\pi}{2}} \frac{x}{\tan(x)} \:dx = \frac{\pi}{2}\ln(2)$$

• For sure, you used the most elegant way to solve the problem. $\to +1$. Oct 23, 2018 at 2:32
• @user3053801 I am fascinated by your analysis but my calculus is limited. Could you elaborate (as if to an undergrad) how you calculated $\frac{dI}{d\omega}?$ Oct 23, 2018 at 2:57
• @user2661923 In employing Leibniz Integral rule (link - en.wikipedia.org/wiki/Leibniz_integral_rule) we make take the derivative of $\omega$ under the integral. Thus, we need to solve $\frac{d}{d\omega} \left[ \arctan(\omega t)\right] = \frac{t}{\omega^2 t^2 + 1}$
– user150203
Oct 23, 2018 at 3:00

Another method I found was to employ integration by parts:

$$\int uv' = uv - \int vu'$$

Let:

\begin{align} u&= x & u'&= 1 \\ v'&= \frac{1}{\tan(x)} = \frac{\cos(x)}{\sin(x)} & v' &= \ln|\sin(x)| \\ \end{align}

Thus,

\begin{align} \int_{0}^{\frac{\pi}{2}} \frac{x}{\tan(x)}\:dx &= \bigg[x \ln|\sin(x)| \bigg]_{0}^{\frac{\pi}{2}} - \int_{0}^{\frac{\pi}{2}}\ln|\sin(x)|\:dx \\ &= - \int_{0}^{\frac{\pi}{2}}\ln|\sin(x)|\:dx \end{align}

From here, one can source the methods as discussed: here