<s>[INST] Evaluate Integral $\int\frac{1+x}{1+x^2}\ dx$ $\int\frac{1+x}{1+x^2}\ dx$
Let $u=1+x^2$
Then $du = 2x\ dx$
Here is my work. 
Split integral $\int\frac{1}{1+x^2}\ dx$ + $\int\frac{x}{1+x^2}\ dx$
Integrate first integral term:
$\int\frac{1}{1+x^2}\ dx=tan^{-1}x$
$\int\frac{x}{1+x^2}\cdot\frac{du}{2x} $
I am stuck when it comes to the second integral term (I hope that is the right term). I have $\frac{du}{2x}$ It does get rid of the x. Should I carry the 2 over by placing outside the second integral. 
 [/INST] $\frac{x}{1+x^2}$ is something of the form $\frac{1}{2}\cdot\frac{f'}{f}$, hence:
$$ \int\frac{1+x}{1+x^2}\,dx = \arctan(x)+\frac{1}{2}\log(1+x^2)+C.$$
</s>