How to evaluate the following integral: $\int_0^1\frac{\log(1+x)}{1+x^2}dx$ I would like to evaluate:
$$\displaystyle\int_0^1 \frac{\log(1+x)}{1+x^2}\, dx$$
I have tried to evaluate this using integration by parts but failed. How can I evaluate it?
 A: By the change of variable 
$$x=\tan t, \qquad dt=\dfrac1{1+x^2}dx,$$ one may just write
$$
\begin{align}
\int_0^1 \frac{\ln(1+x)}{1+x^2}\, dx&= \int_0^{\pi/4} \ln(\cos t +\sin t)\, dt- \int_0^{\pi/4} \ln(\cos t)\, dt\\\\
&=\int_0^{\pi/4} \ln\left(\sqrt{2}\cos \left(\frac \pi4- t\right)\right)\, dt- \int_0^{\pi/4} \ln(\cos t)\, dt\\\\
&=\int_0^{\pi/4} \ln\left(\sqrt{2}\right)\, dt+\int_0^{\pi/4} \ln\left(\cos \left(\frac \pi4- t\right)\right)\, dt- \int_0^{\pi/4} \ln(\cos t)\, dt\\\\
&=\frac{\pi}8 \:\ln 2+\int_0^{\pi/4} \ln(\cos u)\, du-\int_0^{\pi/4} \ln(\cos t)\, dt\quad \left(u=\frac \pi4- t\right)\\\\
&=\frac{\pi}8 \:\ln 2.
\end{align}
$$
A: The previously presented solution is perhaps the simplest. Here is my favorite. 
We define a function $$f(t) = \int^1_0 \frac{\ln (xt+1)}{x^2+1} \text{ d}x.$$ The goal is to evaluate $f(1)$. We notice that $f(0)=0$. Differentiating $f$ with respect to $t$ (and differentiating under the integral; allowable by Leibniz's rule) gives, $$f'(t) = \int^1_0 \frac{x}{(xt+1)(x^2+1)} \text{ d}t.$$ Using partial fractions, we see $$\frac{x}{(xt+1)(x^2+1)} = \frac{A}{xt+1} + \frac{Bx+C}{x^2+1} \,\,\, \implies \,\,\, x = A(x^2+1) + (Bx+C)(xt+1) $$ $$ \implies \,\,\, A+Bt = 0 \,\,\, , \,\,\, B+ Ct = 1 \,\,\, , \,\,\, A + C = 1.$$ This system is uniquely solved by $$A = \frac{-t}{t^2+1} \,\,\, , \,\,\, B = \frac{1}{t^2+1} \,\,\, , \,\,\, C = \frac{t}{t^2+1}.$$ Then \begin{align*} f'(t) &= \int^1_0 \left\{ \frac{A(t)}{xt+1} + \frac{xB(t)}{x^2+1} + \frac{C(t)}{x^2+1} \right \} \text{ d}x \\ &= \left. \left\{ \frac{A(t)}{t} \ln (xt+1) + \frac{B(t)}{2} \ln(x^2+1) + C(t) \tan^{-1}(x) \right\} \right|_{x=0}^{x=1} \\ &= -\frac{\ln(t+1)}{t^2+1} + \frac{\ln(2)}{2}\frac{1}{t^2+1} + \frac{\pi}{4} \frac{t}{t^2+1}.\end{align*} Integrating from $t=0$ to $t=1$ yields $$f(1) = -f(1) + \frac{\ln(2)}{2} \frac{\pi}{4} + \frac{\ln(2)}{2}\frac{\pi}{4}$$ $$\implies \,\, \boxed{f(1) = \frac{\pi \ln(2)}{8}}.$$
