TITLE: Evaluate $\int_0^1\frac{\ln{(x^2+1)}}{x+1}dx$
QUESTION [5 upvotes]: Any idea on how to solve the following definite integral?

$$\int_0^1\frac{\ln{(x^2+1)}}{x+1}dx$$

I have tried to parameterize the integral like $\ln{(a^2x^2+1)}$ or $\ln{(x^2+a^2)}$, which don't seem to work.

REPLY [4 votes]: \begin{equation}
 I = \int_0^1 \frac{\ln\left(x^2 + 1\right)}{x + 1}\:dx
\end{equation}
Here let:
\begin{equation}
 I(t) = \int_0^1 \frac{\ln\left(tx^2 + 1\right)}{x + 1}\:dx
\end{equation}
We observe that $I = I(1)$ and $I(0) = 0$. Thus, 
\begin{align}
 I'(t) &= \int_0^1 \frac{x^2}{\left(tx^2 + 1\right)\left(x + 1\right)}\:dx = \frac{1}{t + 1}\int_0^1 \left[\frac{1}{x + 1} + \frac{x}{tx^2 + 1} - \frac{1}{tx^2 + 1} \right]\:dx \\
&= \frac{1}{t + 1}\bigg[\ln(x + 1) + \frac{1}{2t}\ln\left(tx^2 + 1 \right) + \frac{1}{\sqrt{t}}\arctan\left(\sqrt{t}x\right) \bigg]_0^1 \\
&=\frac{1}{t + 1} \bigg[\ln(2) + \frac{1}{2t}\ln\left(t + 1\right) + \frac{1}{\sqrt{t}}\arctan\left(\sqrt{t}\right)\bigg]
\end{align}
Thus, 
\begin{align}
I(t) &= \int\frac{1}{t + 1} \bigg[\ln(2) + \frac{1}{2t}\ln\left(t + 1\right) + \frac{1}{\sqrt{t}}\arctan\left(\sqrt{t}\right)\bigg]\:dt \\
&=  \int\frac{\ln(2)}{t + 1}\:dt + \int \frac{1}{2t\left(t + 1\right)}\ln\left(t + 1\right)\:dt + \int  \frac{1}{\sqrt{t}\left(t + 1\right)}\arctan\left(\sqrt{t}\right)\:dt \\
&= I_1 + I_2 + I_3 
\end{align}
Solve each individually:
For $I_1$:
\begin{equation}
I_1 =  \int\frac{\ln(2)}{t + 1}\:dt = \ln(2)\ln(t + 1)
\end{equation}
For $I_2$:
\begin{align}
 I_2 &= \int\frac{1}{2t\left(t + 1\right)}\ln\left(t + 1\right)\:dt = \frac{1}{2}\left[ \int \left(\frac{1}{t} - \frac{1}{t + 1} \right)\ln(t + 1)\:dt\right]\\
& =\frac{1}{2} \left[\int \frac{\ln(t + 1)}{t}\:dt - \int \frac{\ln(t + 1)}{t + 1}\:dt \right] \\
&= \frac{1}{2} \left[-\operatorname{Li}_{2}(-t) - \frac{1}{2}\ln^2(t + 1) \right]
\end{align}
Where $\operatorname{Li}_{2}(t)$ is Dilogarithm function. 
For $I_3$:
\begin{equation}
 \int  \frac{1}{\sqrt{t}\left(t + 1\right)}\arctan\left(\sqrt{t}\right)\:dt = \arctan^2\left(\sqrt{t}\right)
\end{equation}
Combining we arrive at:
\begin{equation}
 I(t) = \ln(2)\ln(t + 1) +  \frac{1}{2} \left[-\operatorname{Li}_{2}(-t) - \frac{1}{2}\ln^2(t + 1) \right] + \arctan^2\left(\sqrt{t}\right) + C
\end{equation}
Where $C$ is the constant of integration. 
Using $I(0) = 0$ we see that $C = 0$. Thus
\begin{equation}
 I(t) = \ln(2)\ln(t + 1) +  \frac{1}{2} \left[-\operatorname{Li}_{2}(-t) - \frac{1}{2}\ln^2(t + 1) \right] + \arctan^2\left(\sqrt{t}\right) 
\end{equation}
And finally:
\begin{align}
 I = I(1) &= \ln(2)\ln(1 + 1) +  \frac{1}{2} \left[-\operatorname{Li}_{2}(-1) - \frac{1}{2}\ln^2(1 + 1) \right] + \arctan^2\left(\sqrt{1}\right) \\
&=\ln^2(2) +  \frac{1}{2} \left[-\frac{\pi^2}{12} - \frac{1}{2}\ln^2(2)\right] + \frac{\pi^2}{16} \\
&= \frac{3}{4}\ln^2(2) - \frac{\pi^2}{48}
\end{align}

REPLY [4 votes]: The trick to this integral is a round of integration by parts followed by a direct application of Feynman's Trick. To wit, denote the integral$$\mathfrak{I}=\int\limits_0^1\mathrm dx\,\frac {\log(1+x^2)}{1+x}$$
Now integrate $\mathfrak I$ by parts letting $u=\log(1+x^2)$ and $v=\log(1+x)$. What follows is$$\begin{align*}\mathfrak{I} & =\log(1+x)\log(1+x^2)\,\Biggr\rvert_0^1-2\int\limits_0^1\mathrm dx\,\frac {x\log(1+x)}{1+x^2}\\ & =\log^22-2\int\limits_0^1\mathrm dx\,\frac {x\log(1+x)}{1+x^2}\end{align*}$$
The remaining integral can be evaluated using Feynman's Trick. Insert a parameter $a$ inside the natural logarithm and let $F(a)$ denote the integral. Note that $F(1)$ is what we seek.$$F(a)=\int\limits_0^1\mathrm dx\,\frac {x\log(1+ax)}{1+x^2}$$Proceeding normally, we differentiate with respect to $a$ and separate the remainder into partial fractions to get$$\begin{align*}F'(a) & =\int\limits_0^1\mathrm dx\,\frac {x^2}{(1+ax)(1+x^2)}\\ & =\int\limits_0^1\frac {\mathrm dx}{1+ax}-\int\limits_0^1\frac {\mathrm dx}{(1+ax)(1+x^2)}\end{align*}$$The first integral is trivial$$\int\limits_0^1\frac {\mathrm dx}{1+ax}=\frac {\log(1+a)}a$$The second integral can be evaluated again by separating the fraction and integrating from zero to one. In short, one arrives at the ugly result$$\int\limits_0^1\frac {\mathrm dx}{(1+ax)(1+x^2)}=\frac {a\log(1+a)}{1+a^2}+\frac {a\log 2}{2a^2+2}-\frac {\pi}{4a^2+4}$$Putting everything together, then$$F'(a)=\frac {\log(1+a)}a-\frac {a\log(1+a)}{1+a^2}+\frac {a\log 2}{2a^2+2}-\frac {\pi}{4a^2+4}$$
To arrive back at $F(1)$, we exploit a nifty little trick by instead of taking the indefinite integral of each term, integrate with respect to $a$ from zero to one. The middle term then simply becomes $F(1)$ and the others can be written in terms of the logarithm. Doing all the work, one gets that$$\begin{align*}F(1) & =\frac 12\int\limits_0^1\mathrm da\,\frac {\log(1+a)}a+\frac 14\log 2\int\limits_0^1\mathrm da\,\frac a{1+a^2}-\frac {\pi}8\int\limits_0^1\frac {\mathrm da}{1+a^2}\\ & =\frac {\pi^2}{24}+\frac 18\log^22-\frac {\pi^2}{32}\\ & \,\,\color{red}{=\frac 18\log^22+\frac {\pi^2}{96}}\end{align*}$$
Hence, multiplying $F(1)$ above by two and substituting everything back in, we arrive at the answer as the comments$$\int\limits_0^1\mathrm dx\,\frac {\log(1+x^2)}{1+x}\color{blue}{=\frac 34\log^22-\frac {\pi^2}{48}}$$