Evaluate the following integral:
\[ I = \int_0^1 \frac{\ln(1+x)}{x^2+1} \, dx \]
We begin by using a substitution to simplify the integral. Let’s set:
\[ u = 1 + x \quad \text{so that} \quad du = dx \]
Then the integral becomes:
\[ I = \int_1^2 \frac{\ln u}{(u-1)^2+1} \, du \]
This new form is still non-trivial, but we can attempt a series expansion for the logarithm function. Expanding \( \ln(1+x) \) as a Taylor series around \( x = 0 \):
\[ \ln(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots \]
Substituting this expansion back into the integral:
\[ I = \int_0^1 \frac{x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots}{x^2+1} \, dx \]
Now, we can split this into separate integrals and solve term by term.
The first term is:
\[ I_1 = \int_0^1 \frac{x}{x^2+1} \, dx = \frac{1}{2} \ln 2 \]
The second term is:
\[ I_2 = \int_0^1 \frac{x^2}{x^2+1} \, dx = 1 - \ln 2 \]
Thus, the integral becomes:
\[ I = \frac{1}{2} \ln 2 - \left( 1 - \ln 2 \right) + \cdots \]
As the higher-order terms tend to zero, the final answer is approximately:
\[ I \approx \frac{1}{2} \ln 2 \]