Example question: find the integral $\int \frac{x}{x^4+1} dx$.
In order to solve this, I don't understand why we need to consider $f(z) = \frac{z}{z^4+1}ln(z)$ ?
Where does the $ln(z)$ come from and what does it mean? Is this a general formula?
Please could anyone explain this to me? Thank you.
To do the integral that you posted, there is no need to consider $f(z)=\frac{z}{z^4+1}\ln (z)$.
Instead, consider $f(z)=\frac{z}{z^4+1}$. You can integrate this following the general method for rational functions $r(z)=\frac{p(z)}{q(z)}$ where $\deg p+2\leq \deg q$ (I assume that you want to integrate over all the real line). You can see Ahlfors's book Complex Analysis, section 5.3 for example.