<s>[INST] Decomposition of this partial function I came across this 
$$\int \frac{dx}{x(x^2+1)^2}$$
in "Method of partial functions" in my Calculus I book. 
The thing is that, however, decomposing $\frac{1}{x(x^2+1)^2}$ would take long in this way: 
$$\frac{1}{x(x^2+1)^2}= \frac{A}{x}+\frac{Bx+C}{x^2+1}+\frac{Dx+E}{(x^2+1)^2}$$
So is there a quicker or a more practical way that I can use?  
 [/INST] \begin{equation}
\int \frac{dx}{x(x^2+1)^2}
\end{equation}
\begin{equation}
\frac{1}{x(x+i)^2(x-i)^2}=\dfrac{A}{x}+\dfrac{B}{x+i}+\dfrac{C}{x-i}+\dfrac{D}{(x+i)^2}+\dfrac{E}{(x-i)^2}
\end{equation}


*

*Let $x=0$. Then $A=\dfrac{1}{(0+i)^2(0-i)^2}=1$\

*Let $x=-i$. Then $B=\dfrac{1}{-i(-i-i)^2}=-\dfrac{1}{2}$\

*Let $x=i$. Then $C=\dfrac{1}{i(i+i)^2}=-\dfrac{1}{2}$\


Therefore we have
\begin{eqnarray}
\frac{1}{x(x^2+1)^2}&=&\dfrac{1}{x}-\dfrac{1}{2}\left(\dfrac{1}{x+i}+\dfrac{1}{x-i}\right)+\dfrac{D}{(x+i)^2}+\dfrac{E}{(x-i)^2}\\
&=&\dfrac{1}{x}-\dfrac{x}{x^2+1}+\dfrac{D(x^2-2ix-1)+E(x^2+2ix-1)}{(x^2+1)^2}\\
&=&\dfrac{1}{x}-\dfrac{x}{x^2+1}+\dfrac{(D+E)x^2+2(E-D)ix-(D+E)}{(x^2+1)^2}\\
&=&\dfrac{1}{x}-\dfrac{x}{x^2+1}+\dfrac{2Eix}{(x^2+1)^2}
\end{eqnarray}
Note that since the $x^2$ term must vanish it must be the case that $D=-E$.
Thus we only have to find the value of $E$.
\begin{eqnarray}
\frac{1}{x(x^2+1)^2}&=&\dfrac{1}{x}-\dfrac{x}{x^2+1}+\dfrac{2Eix}{(x^2+1)^2}
\end{eqnarray}
This equation holds for every value of $x$ with the exception of $x=0,i,-i$. Therefore, when $x=1$ it is true that
\begin{eqnarray}
\frac{1}{4}&=&1-\dfrac{1}{2}+\dfrac{E}{2}i\\
E&=&\dfrac{i}{2}
\end{eqnarray}
Therefore
\begin{equation}
\frac{1}{x(x^2+1)^2}=\dfrac{1}{x}-\dfrac{x}{x^2+1}-\dfrac{x}{(x^2+1)^2}
\end{equation}
</s>