Answer
\[\frac{3}{2}\ln (x^2+1)-3\tan^{-1}x+\sqrt 2\tan^{-1}\left(\frac{x}{2}\right)+C\]
Work Step by Step
Let \[I=\int\frac{3x^3-x^2+6x-4}{(x^2+1)(x^2+2)}dx\;\;\;\;\ldots (1)\]
\[\frac{3x^3-x^2+6x-4}{(x^2+1)(x^2+2)}=\frac{Ax+B}{x^2+1}+\frac{Cx+D}{x^2+2}\;\;\;\ldots (2)\]
\[3x^3-x^2+6x-4=(Ax+B)(x^2+2)+(Cx+D)(x^2+1)\;\;\;\]
\[3x^3-x^2+6x-4=Ax^3+2Ax+Bx^2+2B+Cx^3+Cx+Dx^2+D\]
\[3x^3-x^2+6x-4=(A+C)x^3+(B+D)x^2+(2A+C)x+(2B+D)\]
Comparing like coefficients
\[A+C=3\;\;\;\ldots (3)\]
\[B+D=-1\;\;\;\ldots (4)\]
\[2A+C=6\;\;\;\ldots (5)\]
\[2B+D=-4\;\;\;\ldots (6)\]
On Solving (3) and (5)
We get $A=3 \;\;$ and $C=0$
On Solving (4) and (6)
We get $B=-3\;\;$ and $D=2$
With help of (2) , equation (1) becomes
\[I=\int\frac{3x}{x^2+1}dx-\int\frac{3}{x^2+1}dx+\int\frac{2}{x^2+2}dx\;\;\;\ldots (7)\]
\[I=\frac{3}{2}\int\frac{2x}{x^2+1}dx-3\int\frac{dx}{x^2+1^2}+2\int\frac{dx}{x^2+(\sqrt 2)^2}dx\]
\[\left[\int\frac{f'(x)}{f(x)}dx=\ln(f(x))\right]\]
\[\left[\int\frac{1}{x^2+a^2}dx=\frac{1}{a}\tan^{-1}\frac{x}{a}\right]\]
\[I=\frac{3}{2}\ln (x^2+1)-3\tan^{-1}x+\frac{2}{\sqrt 2}\tan^{-1}\left(\frac{x}{2}\right)+C\]
Where $C$ is constant of integration
\[I=\frac{3}{2}\ln (x^2+1)-3\tan^{-1}x+\sqrt 2\tan^{-1}\left(\frac{x}{2}\right)+C\]
Hence
\[I=\frac{3}{2}\ln (x^2+1)-3\tan^{-1}x+\sqrt 2\tan^{-1}\left(\frac{x}{2}\right)+C.\]