How to calculate $\int_0^1\frac{\ln(1+x)}{1+x^2}dx$? [duplicate]

It's obvious that $$\frac1{1+x^2}\,dx = d(\arctan x)$$ Let $$t=\arctan x$$, it becomes $$\int_0^{\frac\pi4}\ln(1+\tan t)\,dt = \int_0^{\frac\pi4}\ln\Bigl(1+\frac{\sin t}{\cos t}\Bigr)\,dt$$ which equals to $$\int_0^{\frac\pi4}\ln\biggl(\frac{\sqrt2\cos(\frac\pi4-t)}{\cos t}\biggr)dt$$ Then I got the right answer in a WRONG way that $$\int_0^{\frac\pi4}\ln\biggl(\frac{\sqrt2\cos(\frac\pi4-t)}{\cos t}\biggr)dt =\int_0^{\frac\pi4}\Bigl[\ln\sqrt2+\cos(\frac\pi4-t)-\cos t\Bigr]dt$$ $$=\frac\pi4\ln\sqrt2-\Bigl[\sin(\frac\pi4-\frac\pi4)-\sin(\frac\pi4-0)\Bigr]-\Bigl[\sin\frac\pi4-\sin0\Bigr]$$ $$=\frac\pi4\ln\sqrt2$$ But actually,$$\int_0^{\frac\pi4}\Bigl[\ln\sqrt2+\cos\Bigl(\frac\pi4-t\Bigr)-\cos t\Bigr]dt$$ should be $$\int_0^{\frac\pi4}\Bigl[\ln\sqrt2+\ln\cos\Bigl(\frac\pi4-t\Bigr)-\ln\cos t\Bigr]dt$$ and I don't know how to calculate this integral.

marked as duplicate by StubbornAtom, N3buchadnezzar, Community♦Apr 24 at 16:57

Just note that $$\int_0^af(a-t)dt=\int_0^af(t)dt$$ by $$t\mapsto a-t$$, so your log-cosines cancel, leaving just $$\frac{\pi}{8}\ln 2$$. Incidentally, we could have avoided the trigonometry with $$x\mapsto\frac{1-x}{1+x}$$ and averaged the new expression for $$I$$ with the old, giving $$I=\frac12\int_0^1\frac{\ln 2dx}{1+x^2}=\frac{\pi}{8}\ln 2.$$The Möbius transformation $$\frac{1-x}{1+x}$$ is a common enough substitution to deserve a name (I don't know one, but I hope someone will leave it in a comment).
Edit: just to make that transformation more explicit, note first that $$\frac{1-\frac{1-x}{1+x}}{1+\frac{1-x}{1+x}}=\frac{1+x-(1-x)}{1+x+1-x}=x,$$so $$y=\frac{1-x}{1+x}=\frac{2}{1+x}-1\implies dx=\frac{-2 dy}{(1+y)^2}\\\implies\int_0^1\frac{\ln (1+x)dx}{1+x^2}=\int_0^1\frac{\ln\frac{2}{1+y}}{1+\left(\frac{1-y}{1+y}\right)^2}\frac{2 dy}{(1+y)^2}=\int_0^1\frac{\ln\frac{2}{1+y}dy}{1+y^2}.$$Adding two expressions for $$I$$, $$2I=\int_0^1\frac{\ln 2 dy}{1+y^2}.$$
• @AKIRA_FuDO I meant $\frac{1-x}{1+x}$, sorry, but I've added some more information. – J.G. Apr 24 at 13:10