karush said:
$$\displaystyle
I=\int \frac{3{x}^{2}-{x}^{2}+6x-4}{({x}^{2}+1)({x}^{2}+2)} \\
=\frac{2}{3}\ln\left({x}^{2}+1\right)-3\arctan\left({x}\right)
+\sqrt{2}\arctan\left({x/\sqrt{2}}\right)+C$$
Was going to take this a step at a time
so by observation this looks like an expasion
The way the answer looks
I'm assuming it's actually $\displaystyle \begin{align*} \int{ \frac{3\,x^3 - x^2 + 6\,x - 4}{\left( x^2 + 1 \right) \left( x^2 + 2 \right) } \,\mathrm{d}x} \end{align*}$, anyway applying Partial Fractions...
$\displaystyle \begin{align*} \frac{A\,x + B}{x^2 + 1} + \frac{C\,x + D}{x^2 + 2} &\equiv \frac{3\,x^3 - x^2 + 6\,x - 4}{\left( x^2 + 1 \right) \left( x^2 + 2 \right) } \\ \frac{ \left( A\,x + B \right) \left( x^2 + 2 \right) + \left( C\,x + D \right) \left( x^2 + 1 \right) }{ \left( x^2 + 1 \right) \left( x^2 + 2 \right) } &\equiv \frac{3\,x^3 - x^2 + 6\,x - 4}{ \left( x^2 + 1 \right) \left( x^2 + 2 \right) } \\ \left( A\,x + B \right) \left( x^2 + 2 \right) + \left( C\,x + D \right) \left( x^2 + 1 \right) &\equiv 3\,x^3 - x^2 + 6\,x - 4 \end{align*}$
Let $\displaystyle \begin{align*} x = \mathrm{i} \end{align*}$ to find $\displaystyle \begin{align*} A\,\mathrm{i} + B = 3\,\mathrm{i} - 3 \implies A = 3 \textrm{ and } B = -3 \end{align*}$.
Let $\displaystyle \begin{align*} x = \sqrt{2}\,\mathrm{i} \end{align*}$ to find $\displaystyle \begin{align*} -\sqrt{2}\,\mathrm{i}\,C - D = 0\,\mathrm{i} - 2 \implies C = 0 \textrm{ and } D = 2 \end{align*}$. So
$\displaystyle \begin{align*} \int{ \frac{3\,x^3 - x^2 + 6\,x - 4}{\left( x^2 + 1 \right) \left( x^2 + 2 \right) } \,\mathrm{d}x } &= \int{ \left( \frac{3\,x - 3}{x^2 + 1} + \frac{2}{x^2 + 2} \right) \,\mathrm{d}x } \\ &= \frac{3}{2} \int{ \frac{2\,x - 2}{x^2 + 1} \,\mathrm{d}x } + 2 \int{ \frac{1}{x^2 + 2} \,\mathrm{d}x } \\ &= \frac{3}{2} \int{ \frac{2\,x}{x^2 + 1} \,\mathrm{d}x } - 3\int{ \frac{1}{x^2 + 1}\,\mathrm{d}x } + 2\int{ \frac{1}{x^2 + 2} \,\mathrm{d}x } \end{align*}$
The first integral can be solved with the substitution $\displaystyle \begin{align*} u = x^2 + 1 \implies \mathrm{d}u = 2\,x\,\mathrm{d}x \end{align*}$, the second can be solved with the substitution $\displaystyle \begin{align*} x = \tan{ \left( \theta \right) } \implies \mathrm{d}x = \sec^2{ \left( \theta \right) } \,\mathrm{d}\theta \end{align*}$, and the third with the substitution $\displaystyle \begin{align*} x = \sqrt{2}\tan{ \left( t \right) } \implies \mathrm{d}x = \sqrt{2}\sec^2{ \left( t \right) }\,\mathrm{d}t \end{align*}$.