The goal is to find this integral: $$\int_0^1\frac{x^2+x+2}{(x+1)(1+x^2)}\,\mathrm{d}x$$
I have been on this question for a long time and I am halfway through solving it:

As shown above, using partial fraction decomposition with two linear factors, I have found that $$\int_0^1 \frac{x^2+x+2}{(x+1)(1+x^2)}\,\mathrm{d}x=\int_0^1 \frac{1}{x+1}\,\mathrm{d}x+\int_0^1\frac{1}{1+x^2}\,\mathrm{d}x$$ Where do I go from here? Any help is appreciated.
For $\int \frac{1}{x+1} \, dx$ you should spot that since the derivative of $\log|x|$ is $1/x$, the derivative of $\log|x+1|$ is $$ \frac{1}{x+1} \cdot \frac{d}{dx}(x+1)=\frac{1}{x+1}\cdot 1 = \frac{1}{x+1} $$ using the chain rule. Hence, $$ \int \frac{1}{x+1} \, dx = \log\left|x+1\right|+C \, , $$ and you can apply the fundamental theorem of calculus to find the definite integral. For $\int_{0}^{1} \frac{1}{1+x^2} \, dx$, it helps to simply know that the derivative of $\arctan x$ is $\frac{1}{1+x^2}$. Failing that, you can make the substitution $x=\tan\theta$. If you do make this substitution, remember to change the integral bounds.