I managed to integrate the right term of that sum and got 1/2ln|1 + x^2| + C, but I am struggling to integrate the left part. I have made 3 substitutions, and have almost got it, but there are always 2 variables in the integral.

You use a trigonometric substitution \(\displaystyle x = \tan{\theta}\), so that \(\displaystyle dx = \sec^2{\theta}\,d\theta\).

Note too that \(\displaystyle \theta = \arctan{x}\).

Therefore

\(\displaystyle \int{\frac{1}{1 + x^2}\,dx} = \int{\frac{1}{1 + \tan^2{\theta}}\,\sec^2{\theta}\,d\theta}\)

\(\displaystyle = \int{\frac{\sec^2{\theta}}{\sec^2{\theta}}\,d\theta}\)

\(\displaystyle = \int{1\,d\theta}\)

\(\displaystyle = \theta + C\)

\(\displaystyle = \arctan{x} + C\).