<s>[INST] Integration of a $\int \frac{v^2+1}{v^3-v^2+v+1}\,dv$ While solving the DE $$\frac{dy}{dx}=\frac{y^2-x^2}{y^2+x^2}$$ with the initial substitution $y=vx$ I got stuck in the integration of  : 
$$\int \frac{v^2+1}{v^3-v^2+v+1}\,dv$$
I don't know how to proceed further. Kindly help.
 [/INST] The main difficulty is that your cubic doesn't have nice roots. Lets call them $v_r$, $v_c$ and $\bar{v_c}$ and let $v_c=a+bi$. I.e.
$$v^3-v^2+v+1=(v-v_r)(v-v_c)(v-\bar{v_c})$$
$$=(v-v_r)(v^2-2av+a^2+b^2)=(v-v_r)((v-a)^2+b^2)$$
Hence we can write:
$$\frac{v^2+1}{v^3-v^2+v+1}=\frac{A}{v-v_r}+\frac{Bv+C}{(v-a)^2+b^2}$$
$$v^2+1=A((v-a)^2+b^2)+(Bv+C)(v-v_r)$$
Next work out the coefficients $A$, $B$, and $C$.
If $v=v_r$ then:
$$v_r^2+1=A((v_r-a)^2+b^2)$$
$$A=\frac{v_r^2+1}{(v_r-a)^2+b^2}$$
If $v=0$ then:
$$1=A(a^2+b^2)+C(-v_r)$$
$$C=\frac{A(a^2+b^2)-1}{v_r}=\frac{2a+v_r(a^2+b^2-1)}{(v_r-a)^2+b^2}$$
Rearranging the equation for $B$ gives:
$$B=\frac{1+v^2-A((v-a)^2+b^2)-C(v-v_r)}{v(v-v_r)}$$
Subbing $A$ and $C$ back in and solving for $B$ gives (note the $v$ cancels out):
$$B=\frac{a^2+b^2-1-2av_r}{(v_r-a)^2+b^2}$$
You can then carry out the integral and finally sub back in the $A$, $B$ and $C$.
$$\int\frac{A}{v-v_r}+\frac{Bv+C}{(v_r-a)^2+b^2)}\ dv$$
$$=A\log{|v-v_r|}+\frac{aB+C}{b}\arctan\left(\frac{v-a}{b}\right)+\frac{B}{2}\log((v-a)^2+b^2)$$
Needless to say it doesn't end up pretty and doesn't have a nice closed form as you also need to substitute in the actual values for $v_r$, $a$ and $b$ which are:
$$v_r=\frac{(3\sqrt{33}-17)^{\frac23}+(3\sqrt{33}-17)^{\frac13}-2}{3(3\sqrt{33}-17)^{\frac13}}$$
$$a=\frac{-(3\sqrt{33}-17)^{\frac23}+2(3\sqrt{33}-17)^{\frac13}+2}{6(3\sqrt{33}-17)^{\frac13}}$$
$$b=\frac{\sqrt{3}(3\sqrt{33}-17)^{\frac13}+2\sqrt{3}}{6(3\sqrt{33}-17)^{\frac13}}$$
Of note Wolframalpha also struggles to express this integral nicely.
</s>