Integrating $\frac{x}{1+x^2}$ I need to integrate $\frac{x}{1+x^2}$ and I tried it like this:
$$f(x)=\frac{x}{1+x^2}=\frac{x}{(x+1)(x-1)}=\frac{x+1-1}{(x+1)(x-1)}= \frac{x+1}{(x+1)(x-1)}-\frac{1}{(x+1)(x-1)}=\frac{1}{x-1}-\frac{1}{1+x^2}$$
After I simplified it I integrate it!
$$\int{f(x)}=\int{\frac{1}{x-1}}-\int{\frac{1}{1+x^2}}$$
$\int{\frac{dx}{1+x^2}}$ becomes arctan(x) and I substitute $\int{\frac{dx}{x-1}}$ to $\int{\frac{du}{u}}$ now it becomes $ln(x-1)$ after this been done I get:
$$\int{f(x)}=ln(x-1)-arctan(x)$$
but when I type integrate x/(1+x^2) into wolframAlpha I it tells me the answer is: $$\int{f(x)}=\frac{1}{2}log(x^2+1)$$
where did I go wrong or what should I have done instead ?
Thank you for your help in advance,
Raavgo
 A: The mistake is at the very beginning: it is not true that $1+x^2 = (1-x)(1+x)$. What you thought about is $1\color{red} - x^2 = (1-x)(1+x)$. (Also, remember that the roots of $1+x^2$ are $\pm \Bbb i$, therefore your factorization is clearly wrong.)
The exercise is much simpler if you notice that $x = \frac 1 2 (1+x^2)'$, therefore
$$\int \frac x {x^2 + 1} \ \Bbb d x = \int \frac {\frac 1 2 (x^2 + 1)'} {x^2 + 1} \ \Bbb d x = \frac 1 2 \log |x^2 + 1| + C ,$$
where $C \in \Bbb R$ is an integration constant.
(I have used the well-known formula that $\int \frac {f'} f \ \Bbb d x = \log |f| + C$.)
A: Hint:
Use the substitution $$1+x^2=t \quad \rightarrow \quad 2xdx=dt$$
A: I would integrate 'by inspection', using the standard result stated above:
$$ \int \frac{f'(x) } {f(x) } \quad dx= ln(f(x)) +c$$
Therefore, answering your question;
$$\int \frac{x} {1+x^2} \quad dx, $$
If $f(x) =x^2 \, then, \, \, f'(x) =2x$
Another equivalent form of the integral becomes;
$${1\over2} \cdot \int \frac{2x} {1+x^2} \quad dx $$
The integral is in the form of $\frac{f' (x) } {f(x) }, $
So the integral may be evaluated as;
$${1 \over 2} \cdot ln(1+x^2)+c$$
Hope this helps. 
A: Easiest way is to use $$\int \frac{f'(x)}{f(x)} dx = \log(f(x)) + c$$
