How can I show that
$$\int_{0}^{\frac{\pi}{4}}\ln(\sqrt{\tan x}+\sqrt{\cot x} -\sqrt{2})\ dx=0$$
I saw this integral on AoPS, and one person provides a solution:
Let $$I:=\int_0^\frac{\pi}{4} \ln(\sqrt{\tan x}+\sqrt{\cot x}-\sqrt 2 ) \ dx, \ \ \ \ \ J:=\int_0^\frac{\pi}{4} \ln(\sqrt{\tan x}+\sqrt{\cot x}+\sqrt 2 ) \ dx.$$I show that $$I=0, \ \ \ \ \ J=\frac{\pi}{2}\ln 2. \ \ \ \ \ \ \ \ \ \ \ \ \ \ (1)$$We have $$I+J=\int_0^{\pi/4}\ln(\tan x+\cot x) \ dx=\int_0^{\pi/4}(\ln 2-\ln(\sin(2x)) \ dx=\frac{1}{2}\int_0^{\pi/2}(\ln 2-\ln(\sin x)) \ dx$$$$=\frac{\pi}{4}\ln 2-\frac{1}{2}\int_0^{\pi/2}\ln(\sin x) \ dx=\frac{\pi}{2}\ln 2. \ \ \ \ \ \ \ \ \ \ \ \ \ (2)$$Next is to compute $I-J.$ To avoid the mess, as much as we can, we put $\tan x = t^2$ to get $$I=\int_0^1\ln\left(t+\frac{1}{t}-\sqrt{2}\right)\frac{2t}{t^4+1} \ dt, \ \ \ \ \ J=\int_0^1\ln\left(t+\frac{1}{t}+\sqrt{2}\right)\frac{2t}{t^4+1} \ dt$$and changing $t$ to $1/t$ gives $$I=\int_1^{\infty}\ln\left(t+\frac{1}{t}-\sqrt{2}\right)\frac{2t}{t^4+1} \ dt, \ \ \ \ \ \ J=\int_1^{\infty}\ln\left(t+\frac{1}{t}+\sqrt{2}\right)\frac{2t}{t^4+1} \ dt.$$Thus $$I=\int_0^{\infty}\ln\left(t+\frac{1}{t}-\sqrt{2}\right)\frac{t}{t^4+1} \ dt, \ \ \ \ \ \ J=\int_0^{\infty}\ln\left(t+\frac{1}{t}+\sqrt{2}\right)\frac{t}{t^4+1} \ dt$$and hence, since $\int_0^{\infty} \frac{t\ln t}{t^4+1} \ dt=0$ (just change $t$ to $1/t$ to see that), we get $$I=\int_0^{\infty}\frac{t\ln(t^2-\sqrt{2}t+1)}{t^4+1} \ dt, \ \ \ \ \ J=\int_0^{\infty}\frac{t\ln(t^2+\sqrt{2}t+1)}{t^4+1} \ dt.$$Therefore $$I-J=\int_0^{\infty}\frac{t}{t^4+1}(\ln(t^2-\sqrt{2}t+1)-\ln(t^2+\sqrt{2}t+1)) \ dt. \ \ \ \ \ \ \ \ \ \ \ (3)$$We now use integration by parts with $\frac{t}{t^4+1} \ dt=dv, \ \ \ \ln(t^2-\sqrt{2}t+1)-\ln(t^2+\sqrt{2}t+1)=u.$ Then $$v=\frac{1}{2}\tan^{-1}(t^2), \ \ \ du=\frac{2\sqrt{2}(t^2-1)}{t^4+1} \ dt$$and so $(3)$ becomes $$I-J=-\sqrt{2}\int_0^{\infty}\frac{t^2-1}{t^4+1}\tan^{-1}(t^2) \ dt=-\sqrt{2}\int_0^{\infty}\frac{t^2-1}{t^4+1}\int_0^1\frac{t^2}{s^2t^4+1} \ ds \ dt=-\sqrt{2}\int_0^1\int_0^{\infty}\frac{t^2(t^2-1)}{(t^4+1)(s^2t^4+1)} \ dt \ ds$$$$=-\sqrt{2}\int_0^1\frac{1}{1-s^2}\left(\int_0^{\infty}\frac{s^2t^2+1}{s^2t^4+1} \ dt-\int_0^{\infty}\frac{t^2+1}{t^4+1} \ dt \right)ds.$$So changing $t$ to $t/\sqrt{s}$ in $\int_0^{\infty}\frac{s^2t^2+1}{s^2t^4+1} \ dt$ gives $$I-J=-\sqrt{2}\int_0^1\frac{1}{1-s^2}\left((\sqrt{s}-1)\int_0^{\infty}\frac{t^2}{t^4+1} \ dt+\left(\frac{1}{\sqrt{s}}-1\right)\int_0^{\infty} \frac{dt}{t^4+1}\right)ds$$$$=-\frac{\pi}{2}\int_0^1\frac{1}{1-s^2}\left(\sqrt{s}+\frac{1}{\sqrt{s}}-2\right)ds=-\frac{\pi}{2}\ln 2. \ \ \ \ \ \ \ \ \ \ \ (4)$$Now $(1)$ follows from $(2)$ and $(4).$
This is an elegant solution, but I wonder if there are other ways to solve the integral.