Evaluate the following integral:
$\int \frac{1}{\left(x^{2}+1\right)\left(x^{2}+2\right)} d x$
Let, $I=\int \frac{1}{\left(x^{2}+1\right)\left(x^{2}+2\right)} d x$
Let, $x^{2}=y$
Then, $\frac{1}{(\mathrm{y}+1)(\mathrm{y}+2)}=\frac{\mathrm{A}}{\mathrm{y}+1}+\frac{\mathrm{B}}{\mathrm{y}+2}$
$\Rightarrow 1=A(y+2)+B(y+1)$
$\Rightarrow 1=(A+B) y+2 A+B$
On equating similar terms, we get,
$A+B=0$, and $2 A+B=1$
We get, $A=1, B=-1$
$\therefore \mathrm{I}=\int \frac{\mathrm{dx}}{\mathrm{x}^{2}+1}-\int \frac{\mathrm{dx}}{\mathrm{x}^{2}+2}$
$\Rightarrow \mathrm{I}=\tan ^{-1} \mathrm{x}-\frac{1}{\sqrt{2}} \tan ^{-1}\left(\frac{\mathrm{x}}{\sqrt{2}}\right)+\mathrm{c}$
So, $\int \frac{1}{\left(x^{2}+1\right)\left(x^{2}+2\right)} d x=\tan ^{-1} x-\frac{1}{\sqrt{2}} \tan ^{-1}\left(\frac{x}{\sqrt{2}}\right)+c$