Difficulties solving this integral: $ \int_0^1 \frac{\ln(x+1)} {x^2 + 1} \, \mathrm{d}x $ by differentiation under the integral sign So in the book Advanced Calculus Explored, by Hamza E. Asamraee. The next integral appears as an exercise to solve by differentiating under the integral sign:
$$ \int_0^1 \frac{\ln(x+1)} {x^2 + 1} \, \mathrm{d}x $$
I have solved this integral before by substitution and change in the limits of integration, but in this chapter the book asks to solve it by differentiation under the integral sign. I have tried several ways of solving this, but the only one that i thought it was leading me somewhere was:
$$f(a) = \int_0^1 \frac{\ln(x+a)} {x^2 + 1} \, \mathrm{d}x $$
So that:
$$f'(a) = \int_0^1 \frac{1} {(x+a)(x^2 + 1)} \, \mathrm{d}x $$
Then i tried to separate this last integral by partial fractions, my result on this was:
$$\frac {1} {(x+a)(x^2 + 1)} = \frac{1} {a^2 + 1} \left(\frac {1} {x+a} - \frac{x-a} {x^2+1}\right)$$
And the integral reduces to:
$$f'(a) = \int_0^1 \frac{1} {a^2 + 1} \left(\frac {1} {x+a} - \frac{x-a} {x^2+1} \right) \, \mathrm{d}x $$
Then this last expression evaluates to:
$$f'(a) = \frac{1} {a^2 + 1} (\ln(a+1) - \ln(a) - \ln(4)+ \frac{π}{4} a)$$
Then integrating from 0 to 1 with respect to $a$ we will get:
$$f(1) - f(0) = \int_0^1 \frac{\ln(a+1)} {a^2 + 1} \, \mathrm{d}a - \int_0^1 \frac{\ln(a)} {a^2 + 1} \, \mathrm{d}a $$
(The last two terms of $f'(a)$ cancel each other after the integration so i didn't wrote them)
But then the two integrals on the right hand side are equal to $f(1) - f(0)$ so the differentiation under the integral led nowhere.
Do i need some other approach? Or did i made any mistake?
Any help is appreciated.
 A: This would work:
$$I(a) = \int_0^1 \frac{\ln(ax+1)}{x^2+1} dx \\ 
I’(a) =\int_0^1 \frac{x}{(x^2+1)(ax+1)} dx \\ \overset{\text{partial fractions}}= \\ \frac{-2\ln |ax+1| +\ln(x^2+1)+2a\tan^{-1} x}{2(a^2+1)} \bigg |_0^1 \\ =-\frac{\ln(a+1)}{a^2+1}+\frac{\ln 2}{2a^2+2}+\frac{\pi}{4} \frac{a}{a^2+1}
$$
Integrating from $0$ to $1$, $$I(1)-I(0) = -I(1) +\int_0^1 \left(\frac{\ln 2}{2a^2+2}+\frac{\pi}{4} \frac{a}{a^2+1}\right) da$$
Hopefully you can finish.
A: Even if I think that @Tavish's solution is the most efficient, wht you did must work.
$$f(a) = \int_0^1 \frac{\log(x+a)} {x^2 + 1}  \,dx$$
$$f'(a) = \frac{1} {a^2 + 1} \left(\log(a+1) - \log(a) - \ln(4)+ \frac{\pi}{4} a\right)$$ Now, you must use $a^2+1=(a+i)(a-i)$ to make
$$ \int f'(a)\,da=\frac{1}{8} \pi  \log \left(a^2+1\right)+\frac{1}{2} i \text{Li}_2(-i
   a)-\frac{1}{2} i \text{Li}_2(i a)-$$ $$\frac{1}{2} i
   \text{Li}_2\left(\left(\frac{1}{2}-\frac{i}{2}\right) (a+1)\right)+\frac{1}{2} i
   \text{Li}_2\left(\left(\frac{1}{2}+\frac{i}{2}\right) (a+1)\right)-$$ $$\frac{1}{2} i
   \log ((1+i)-(1-i) a) \log (a+1)+\frac{1}{2} i \log (-(1+i) (a+i)) \log
   (a+1)-$$ $$\log (a) \tan ^{-1}(a)-\frac{1}{2} \log (2) \tan ^{-1}(a)$$
$$ \int_0^1 f'(a)\,da=\frac{1}{2} (2 C-i (\text{Li}_2(1-i)-\text{Li}_2(1+i))+\pi  \log (2))-\frac{1}{2} i
   \left(\text{Li}_2\left(\frac{1}{2}+\frac{i}{2}\right)-\text{Li}_2\left(\frac{1}{
   2}-\frac{i}{2}\right)\right)=C+\frac{1}{8} \pi  \log (2)$$ Since
$$\int_0^1 \frac{\log(x)} {x^2 + 1}  \,dx=-C$$ then the result.
A: $$f(x)=\frac{1}{(x+a)(x^2+1)}=$$
$$\frac{A}{x+a}+\frac{Bx+C}{x^2+1}$$
we find that $$A=\frac{1}{a^2+1}$$
and
$$Bi+C=\frac{1}{a+i}=\frac{a-i}{a^2+1}$$
So,
$$B=-\frac{1}{a^2+1}\;,\;C=\frac{a}{a^2+1}$$
