I was solving the following integral:
$$I=\int_0^{\pi/2} \frac{\sqrt{\tan x}}{\sin x(\cos x+\sin x)}\mathrm{d}x $$
Using the identity $\sin x=\frac{\tan x}{\sec x}$, I simplified the integral in the following way:
$$I=\int_0^{\pi/2}\frac{\sqrt{\tan x}}{\frac{\tan x}{\sec x}\left(\cos x+\frac{\tan x}{\sec x}\right)}\mathrm{d}x=\int_0^{\pi/2}\frac{\sec^2 x}{\sqrt{\tan x}(1+\tan x)}\mathrm{d}x=2\tan^{-1}(\sqrt{\tan x})\Bigg|^{\pi/2}_0=\lim_{x\to \pi/2} 2\tan^{-1}(\sqrt{\tan x})=\pi $$
However, I'd like to see a different solution, because I feel there's a simpler one maybe using the symmetry of the integrand:
$$\int_0^{\pi/2} \frac{\sqrt{\tan x}}{\sin x(\cos x+\sin x)}\mathrm{d}x=2\int_0^{\pi/4} \frac{\sqrt{\tan x}}{\sin x(\cos x+\sin x)}\mathrm{d}x $$
Evaluating $\int_0^{\pi/2} \frac{\sqrt{\tan x}}{\sin x(\cos x+\sin x)}\mathrm{d}x$
calculusdefinite integralsintegrationtrigonometric-integrals
Related Solutions
Here's one way to go.
First, note that $$\begin{eqnarray*} \int_0^\pi\frac{3\cos x+\sqrt{8+\cos^2 x}}{\sin x}x\ \mathrm dx &=& \int_0^\pi\frac{3x(1+\cos x)}{\sin x} \mathrm dx +\int_0^\pi\frac{3x}{\sin x} \left(-1+\sqrt{1-\frac{\sin^2x}{9}}\right)\ \mathrm dx. \end{eqnarray*}$$ For now I'll simply claim that \begin{equation*} \int_0^\pi\frac{3x(1+\cos x)}{\sin x} \mathrm dx = \pi\log 64.\tag{1} \end{equation*} (I would be surprised if this integral has not been handled somewhere on this site.) But $$\begin{eqnarray*} \int_0^\pi\frac{3x}{\sin x} \left(-1+\sqrt{1-\frac{\sin^2x}{9}}\right)\ \mathrm dx &=& \int_0^\pi\frac{3x}{\sin x} \sum_{k=1}^\infty {1/2\choose k} \frac{(-1)^k}{3^{2k}} \sin^{2k}x \ \mathrm dx \\ &=& \sum_{k=1}^\infty {1/2\choose k} \frac{(-1)^k}{3^{2k-1}} \int_0^\pi x \sin^{2k-1}x \ \mathrm dx \\ &=& \sum_{k=1}^\infty {1/2\choose k} \frac{(-1)^k}{3^{2k-1}} \frac{\pi^{3/2}\Gamma(k)}{2\Gamma(k+1/2)} \\ &=& -\pi \sum_{k=1}^\infty \frac{1}{3^{2k-1}2k(2k-1)} \\ &=& -\pi \log \frac{32}{27}. \end{eqnarray*}$$ (The last sum can be found by standard methods. Schematically, $\sum \frac{a^{2k-1}}{2k(2k-1)} = \sum \int {\mathrm da} \frac{a^{2k-2}}{2k}$.) Thus, the integral is $\pi \log 54$ as claimed.
Proof of (1): We have $$\begin{eqnarray*} \int_0^\pi \frac{3x(1+\cos x)}{\sin x} \ \mathrm dx &=& \int_{0^+}^\pi \frac{3x(1+\cos x)}{\sin x} \ \mathrm dx \\ &=& 3\int_{0^+}^\pi x \cot\frac{x}{2} \ \mathrm dx \hspace{5ex}\textrm{(double angle formulas)} \\ &=& 12 \int_{0^+}^{\pi/2} t\cot t \ \mathrm dt \hspace{5ex} (t = x/2) \\ &=& -12\int_{0^+}^{\pi/2} \log\sin t \ \mathrm dt \hspace{5ex}\textrm{(integrate by parts)} \\ &=& -6\int_{0^+}^{\pi/2} \log\sin^2 t \ \mathrm dt \\ &=& -6\int_{0^+}^{\pi/2} \log(1-\cos^2 t) \ \mathrm dt \\ &=& 6 \int_{0^+}^{\pi/2} \sum_{k=1}^\infty \frac{1}{k}\cos^{2k}t \ \mathrm dt \hspace{5ex}\textrm{(series for log)} \\ &=& 6\sum_{k=1}^\infty \frac{1}{k} \int_{0^+}^{\pi/2} \cos^{2k}t \ \mathrm dt \hspace{5ex} \textrm{(Tonelli's theorem)}\\ &=& 6\sum_{k=1}^\infty \frac{1}{k} \frac{\sqrt{\pi}\Gamma(k+1/2)}{2\Gamma(k+1)} \\ &=& 3\pi \sum_{k=1}^\infty {1/2 \choose k}(-1)^{k+1}\frac{2k-1}{k} \\ &=& \pi \log 64. \end{eqnarray*}$$ Note that $$\begin{eqnarray*} 6\pi \sum_{k=1}^\infty {1/2 \choose k}(-1)^{k+1} &=& -6\pi \left[\sum_{k=0}^\infty {1/2 \choose k}(-1)^{k} - 1\right] \\ &=& -6\pi[(1-1)^{1/2} - 1] \\ &=& 6\pi \end{eqnarray*}$$ and $$\begin{eqnarray*} -3\pi \sum_{k=1}^\infty {1/2 \choose k}(-1)^{k+1} \frac{1}{k} &=& 3\pi \sum_{k=1}^\infty {1/2\choose k}(-1)^k \int_0^1 x^{k-1} \ \mathrm dx \\ &=& 3\pi \int_0^1 \frac{1}{x} \left[ \sum_{k=0}^\infty {1/2\choose k}(-1)^k x^{k} -1 \right] \ \mathrm dx \\ &=& 3\pi \int_0^1 \frac{1}{x} \left( \sqrt{1-x} -1 \right) \ \mathrm dx \\ &=& 3\pi(-2+\log 4) \\ &=& -6\pi + \pi\log 64. \end{eqnarray*}$$
On the path of Zacky, the missing part...
Let,
\begin{align}I&=\int_0^{\frac{\pi}{2}}x^2\sqrt{\tan x}\,dx\\ J&=\int_0^{\frac{\pi}{2}}\frac{x^2}{\sqrt{\tan x}}\,dx\\ \end{align}
Perform the change of variable $y=\sqrt{\tan x}$,
\begin{align}I&=\int_0^{\infty}\frac{2x^2\arctan^2\left(x^2\right)}{1+x^4}\,dx\\\\ J&=\int_0^{\infty}\frac{2x^2\arctan^2\left(\frac{1}{x^2}\right)}{1+x^4}\,dx\\ \end{align}
\begin{align} \text{I+J}&=\int_0^{\infty}\frac{2x^2\left(\arctan\left(x^2\right)+\arctan\left(\frac{1}{x^2}\right)\right)^2}{1+x^4}\,dx-4\int_0^{\infty}\frac{x^2\arctan\left(x^2\right)\arctan\left(\frac{1}{x^2}\right)}{1+x^4}\,dx\\ &=\frac{\pi^2}{4}\int_0^{\infty}\frac{2x^2}{1+x^4}\,dx-4\int_0^{\infty}\frac{x^2\arctan\left(x^2\right)\arctan\left(\frac{1}{x^2}\right)}{1+x^4}\,dx\\ \end{align}
Perform the change of variable $y=\dfrac{1}{x}$,
\begin{align} \text{K}&=\int_0^{\infty}\frac{2x^2}{1+x^4}\,dx\\ &=\int_0^{\infty}\frac{2}{1+x^4}\,dx\\ \end{align}
Therefore,
\begin{align} \text{2K}=\int_0^{\infty}\frac{2\left(1+\frac{1}{x^2}\right)}{\left(x-\frac{1}{x}\right)^2+2}\,dx \end{align}
Perform the change of variable $y=x-\dfrac{1}{x}$,
\begin{align}\text{2K}&=2\int_{-\infty}^{+\infty}\frac{1}{2+x^2}\,dx\\ &=2\left[\frac{1}{\sqrt{2}}\arctan\left(\frac{x}{\sqrt{2}}\right)\right]_{-\infty}^{+\infty}\\ &=2\times \frac{\pi}{\sqrt{2}} \end{align}
therefore,
\begin{align} \text{I+J}&=\frac{\pi^3}{4\sqrt{2}}-4\int_0^{\infty}\frac{x^2\arctan\left(x^2\right)\arctan\left(\frac{1}{x^2}\right)}{1+x^4}\,dx\\ \end{align}
Let $a>0$,
\begin{align} \text{K}_1(a)&=\int_0^{\infty}\frac{x^2}{a+x^4}\,dx\\ &=\frac{1}{a}\int_0^{\infty}\frac{x^2}{1+\left(a^{-\frac{1}{4}}x\right)^4}\,dx\\ \end{align}
Perform the change of variable $y=a^{-\frac{1}{4}}x$,
\begin{align} \text{K}_1(a)&=a^{-\frac{1}{4}}\int_0^{\infty}\frac{x^2}{1+x^4}\,dx\\ &=\frac{a^{-\frac{1}{4}}\pi}{2\sqrt{2}} \end{align}
In the same manner,
\begin{align} \text{K}_2(a)&=\int_0^{\infty}\frac{x^2}{1+ax^4}\,dx\\ &=\frac{a^{-\frac{3}{4}}\pi}{2\sqrt{2}} \end{align}
Since, for $a$ real,
\begin{align}\arctan a=\int_0^1 \frac{a}{1+a^2t^2}\,dt\end{align}
then,
\begin{align}\text{L}&=\int_0^{\infty}\frac{x^2\arctan\left(x^2\right)\arctan\left(\frac{1}{x^2}\right)}{1+x^4}\,dx\\ &=\int_0^{\infty}\left(\int_0^1 \int_0^1 \frac{x^2}{(1+u^2x^4)\left(1+\frac{v^2}{x^4}\right)(1+x^4)}\,du\,dv\right)\,dx\\ &=\\ &\int_0^{\infty}\left(\int_0^1\int_0^1 \left(\frac{x^2}{(1-u^2)(1-v^2)(1+x^4)}-\frac{x^2}{1-u^2v^2}\left(\frac{u^2}{(1-u^2)(1+u^2x^4)}+\frac{v^2}{(1-v^2)(v^2+x^4)}\right) \right)dudv\right)dx\\ &=\int_0^1\int_0^1 \left(\frac{\pi}{2\sqrt{2}(1-u^2)(1-v^2)}-\frac{1}{1-u^2v^2}\left(\frac{u^2\text{K}_2(u^2)}{1-u^2}+\frac{v^2\text{K}_1(v^2)}{1-v^2}\right)\right)dudv\\ &=\frac{\pi}{2\sqrt{2}}\int_0^1\int_0^1 \left(\frac{1}{(1-u^2)(1-v^2)}-\frac{1}{(1-u^2v^2)}\left(\frac{u^{\frac{1}{2}}}{1-u^2}+\frac{v^{\frac{3}{2}}}{1-v^2}\right)\right)dudv\\ &=\pi\int_0^1\left[\frac{\sqrt{v}\left(\text{ arctanh}\left(\sqrt{uv}\right)-\text{ arctan}\left(\sqrt{uv}\right)-\text{ arctanh}\left(uv\right)\right)+\arctan\left(\sqrt{u}\right)+\ln\left(\frac{\sqrt{1+u}}{1+\sqrt{u}}\right)}{2\sqrt{2}(1-v^2)}\right]_{u=0}^{u=1}\,dv\\ &=\frac{\pi}{2\sqrt{2}}\int_0^1\frac{\sqrt{v}\big(\text{ arctanh}\left(\sqrt{v}\right)-\text{ arctan}\left(\sqrt{v}\right)-\text{ arctanh}\left(v\right)\big)+\frac{\pi}{4}-\frac{1}{2}\ln 2}{1-v^2}\,dv\\ &=\frac{\pi}{2\sqrt{2}}\int_0^1\frac{\sqrt{v}\arctan\left(\frac{1-\sqrt{v}}{1+\sqrt{v}}\right)}{1-v^2}\,dv+\frac{\pi}{2\sqrt{2}}\left(\frac{\pi}{4}-\frac{1}{2}\ln 2\right)\int_0^1 \frac{1-\sqrt{v}}{1-v^2}\,dv+\\ &\frac{\pi}{2\sqrt{2}}\int_0^1\frac{\sqrt{v}\ln\left(\frac{1+\sqrt{v}}{2}\right)}{1-v^2}\,dv-\frac{\pi}{4\sqrt{2}}\int_0^1\frac{\sqrt{v}\ln\left(\frac{1+v}{2}\right)}{1-v^2}\,dv \end{align}
Perform the change of variable $y=\dfrac{1-\sqrt{v}}{1+\sqrt{v}}$,
\begin{align}\text{R}_1&=\int_0^1\frac{\sqrt{v}\arctan\left(\frac{1-\sqrt{v}}{1+\sqrt{v}}\right)}{1-v^2}\,dv\\ &=\frac{1}{2}\int_0^1 \frac{(1-v)^2\arctan v}{v(1+v^2)}\,dv\\ &=\frac{1}{2}\int_0^1 \frac{\arctan v}{v}\,dv-\int_0^1 \frac{\arctan v}{1+v^2}\,dv\\ &=\frac{1}{2}\text{G}-\frac{1}{2}\Big[\arctan^2 v\Big]_0^1\\ &=\frac{1}{2}\text{G}-\frac{\pi^2}{32}\\ \text{R}_2&=\int_0^1 \frac{1-\sqrt{v}}{1-v^2}\,dv\\ &=\left[\ln\left(\frac{\sqrt{1+v}}{1+\sqrt{v}}\right)+\arctan\left(\sqrt{v}\right)\right]_0^1\\ &=\frac{\pi}{4}-\frac{1}{2}\ln 2\\ \end{align}
Perform the change of variable $y=\dfrac{1-\sqrt{v}}{1+\sqrt{v}}$,
\begin{align}\text{R}_3&=\int_0^1\frac{\sqrt{v}\ln\left(\frac{1+\sqrt{v}}{2}\right)}{1-v^2}\,dv\\ &=-\frac{1}{2}\int_0^1\frac{(1-v)^2\ln(1+v)}{v(1+v^2)}\,dv\\ &=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv-\frac{1}{2}\int_0^1 \frac{\ln(1+v )}{v}\,dv\\ &=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv-\frac{1}{4}\int_0^1 \frac{2v\ln(1-v^2)}{v^2}\,dv+\frac{1}{2}\int_0^1 \frac{\ln(1-v)}{v}\,dv\\ \end{align}
In the second integral perform the change of variable $y=v^2$,
\begin{align}\text{R}_3&=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv+\frac{1}{4}\int_0^1 \frac{\ln(1-v)}{v}\,dv\\ \end{align}
In the second integral perform the change of variable $y=1-v$,
\begin{align}\text{R}_3&=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv+\frac{1}{4}\int_0^1 \frac{\ln v}{1-v}\,dv\\ &=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv+\frac{1}{4}\times -\zeta(2)\\ &=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv-\frac{\pi^2}{24}\\ \end{align}
Perform the change of variable $y=\dfrac{1-v}{1+v}$,
\begin{align} \text{S}_1&=\int_0^1\frac{\ln(1+v)}{1+v^2}\,dv\\ &=\int_0^1\frac{\ln(\frac{2}{1+v})}{1+v^2}\,dv\\ &=\ln 2\int_0^1 \frac{1}{1+v^2}\,dv-\text{S}_1\\ &=\frac{\pi}{4}\ln 2-\text{S}_1 \end{align}
Therefore,
\begin{align} \text{S}_1&=\frac{\pi}{8}\ln 2\\ \text{R}_3&=\frac{\pi}{8}\ln 2-\frac{\pi^2}{24}\\ \end{align}
Perform the change of variable $y=\dfrac{1-\sqrt{v}}{1+\sqrt{v}}$,
\begin{align} \text{R}_4&=\int_0^1\frac{\sqrt{v}\ln\left(\frac{1+v}{2}\right)}{1-v^2}\,dv\\ &=\frac{1}{2}\int_0^1 \frac{(1-v)^2\ln\left(\frac{1+v^2}{(1+v)^2}\right)}{v(1+v^2)}\,dv\\ &=\frac{1}{2}\int_0^1 \frac{(1-v)^2\ln\left(1+v^2\right)}{v(1+v^2)}\,dv+2\text{R}_3\\ &=\frac{1}{2}\int_0^1\frac{\ln(1+v^2)}{v}\,dv-\int_0^1\frac{\ln(1+v^2)}{1+v^2}\,dv+\frac{\pi}{4}\ln 2-\frac{\pi^2}{12}\\ &=\frac{1}{2}\times \frac{1}{4}\zeta(2)-\int_0^1\frac{\ln(1+v^2)}{1+v^2}\,dv+\frac{\pi}{4}\ln 2-\frac{\pi^2}{12}\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}-\int_0^1\frac{\ln(1+v^2)}{1+v^2}\,dv\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}-\int_0^1\int_0^1\frac{v^2}{(1+v^2)(1+v^2t)}\,dt\,dv\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}-\int_0^1 \left[\frac{\arctan\left(v\right)\sqrt{t}-\arctan\left(v\sqrt{t}\right)}{(t-1)\sqrt{t}}\right]_{v=0}^{v=1}\,dt\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}-\int_0^1 \frac{\frac{\pi\sqrt{t}}{4}-\arctan\left(\sqrt{t}\right)}{(t-1)\sqrt{t}}\,dt\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}+\int_0^1 \frac{\arctan\left(\frac{1-\sqrt{t}}{1+\sqrt{t}}\right)}{(1-t)\sqrt{t}}\,dt-\frac{\pi}{4}\int_0^1 \frac{\sqrt{t}-1}{(t-1)\sqrt{t}}\,dt\\ &=\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}+\int_0^1 \frac{\arctan\left(\frac{1-\sqrt{t}}{1+\sqrt{t}}\right)}{(1-t)\sqrt{t}}\,dt-\frac{\pi}{4}\Big[2\ln\left(1+\sqrt{t}\right)\Big]_0^1\\ &=\int_0^1 \frac{\arctan\left(\frac{1-\sqrt{t}}{1+\sqrt{t}}\right)}{(1-t)\sqrt{t}}\,dt-\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}\\ \end{align}
Perform the change of variable $y=\dfrac{1-\sqrt{t}}{1+\sqrt{t}}$,
\begin{align} \text{R}_4&=\int_0^1 \frac{\arctan t}{t}\,dt-\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}\\ &=\text{G}-\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}\\ \end{align}
Therefore,
\begin{align}L&=\frac{\pi}{2\sqrt{2}}\text{R}_1+\frac{\pi}{2\sqrt{2}}\left(\frac{\pi}{4}-\frac{1}{2}\ln 2\right) \text{R}_2+\frac{\pi}{2\sqrt{2}}\text{R}_3-\frac{\pi}{4\sqrt{2}}\text{R}_4\\ &=\frac{\pi}{2\sqrt{2}}\left(\frac{\text{G}}{2}-\frac{\pi^2}{32}\right)+\frac{\pi}{2\sqrt{2}}\left(\frac{\pi}{4}-\frac{1}{2}\ln 2\right)^2+\frac{\pi}{2\sqrt{2}}\left(\frac{\pi}{8}\ln 2-\frac{\pi^2}{24}\right)-\\ &\frac{\pi}{4\sqrt{2}}\left(\text{G}-\frac{\pi}{4}\ln 2-\frac{\pi^2}{16}\right)\\ &=\frac{\pi^3}{96\sqrt{2}}+\frac{\pi\ln^2 2}{8\sqrt{2}} \end{align}
Thus, \begin{align}\text{I+J}&=\frac{\pi^3}{4\sqrt{2}}-4\text{L}\\ &=\frac{\pi^3}{4\sqrt{2}}-4\left(\frac{\pi^3}{96\sqrt{2}}+\frac{\pi\ln^2 2}{8\sqrt{2}}\right)\\ &=\boxed{\frac{5\pi^3}{24\sqrt{2}}-\frac{\pi\ln^2 2}{2\sqrt{2}}} \end{align}
Best Answer
Substitute $t=\sqrt{\tan x}-\sqrt{\cot x}$. Then $$ dt =\frac{\sqrt{\cot x}+\sqrt{\tan x}}{2\sin x \cos x}dx,\>\>\>\>\> t^2+4=\frac{(\sin x + \cos x)^2}{\sin x \cos x} $$ and \begin{align} &\int_0^{\pi/2} \frac{\sqrt{\tan x}}{\sin x(\cos x+\sin x)}{d}x\\ =&\int_0^{\pi/2} \frac{\sqrt{\tan x}+\sqrt{\cot x}}{(\sin x +\cos x)^2}dx=\int_{-\infty}^\infty\frac{2}{t^2+4}dt=\pi \end{align}