General stochastic integration by parts. For $W_t$ the Brownian motion,
Let $X_t$, $Y_t$ be two diffusions, then since $$d(X_tY_t) = X_tdY_t+Y_tdX_t+dX_tdY_t$$ the generic stochastic integration by parts formula is given by $$\int_a^bX_t\,dY_t=X_bY_b-X_aY_a-\int_a^bY_t\,dX_t - \int_a^bdX_t\,dY_t$$
May I clarify for $\int_0^T \frac{1}{1+W_t^2}\,dW_t$, can I use the generic stochastic integration by parts formula? 
Assuming I can use it, I obtain
\begin{align}
\int_0^T \frac{1}{1+W_t^2}\,dW_t &= \frac{W_T}{1+W_T^2}+2\int_0^T\frac{W_t^2}{(1+W_t^2)^2}\,dW_t + 3\int_0^T\frac{W_t}{(1+W_t^2)^2}\,dt-4\int_0^T\frac{W_t^3}{(1+W_t^2)^3}\,dt
\end{align}
since by Ito's lemma, $d\left(\frac{1}{1+W_t^2}\right) = -\frac{2W_t}{(1+W_t^2)^2}\,dW_t -\frac{1}{(1+W_t^2)^2}dt + \frac{4W_t^2}{(1+W_t^2)^3}dt$ 
and
$dW_t\,d\left(\frac{1}{1+W_t^2}\right) = -\frac{2W_t}{(1+W_t^2)^2}\,dt$
On the other hand, should I use the integration by parts formula: 
$$\int_a^b g'(W_t)\,dW_t=\left[g(W_t)\right]_{t=a}^{t=b} -\frac{1}{2}\int_a^bg''(W_t)\,dt$$ I obtain
$$\int_0^T\frac{1}{1+W_t^2}\,dW_t = tan^{-1}(W_T)+\int_0^T\frac{W_t}{(1+W_t^2)^2}\,dt \quad \forall T>0$$
which appears to be rather different from the former...
I would appreciate any advice! 

Technically, you have written the following equation in a different form :
 \begin{align}
\int_0^T \frac{1}{1+W_t^2}\,dW_t &= \frac{W_T}{1+W_T^2}+2\int_0^T\frac{W_t^2}{(1+W_t^2)^2}\,dW_t + 3\int_0^T\frac{W_t}{(1+W_t^2)^2}\,dt-4\int_0^T\frac{W_t^3}{(1+W_t^2)^3}\,dt
\end{align}
to 
\begin{align}
\int_0^T\frac{1}{1+W_t^2}\,dW_t = tan^{-1}(W_T)+\int_0^T\frac{W_t}{(1+W_t^2)^2}\,dt
\end{align}
You can check that by applying Ito's lemma to $\arctan(W_t)$, you will find the first form if your calculations are correct.
