Given \[\int \frac{dx}{(x+2)(x^{2}+1)}=a \log |x^{2}+1| +b\tan ^{-1}x+\frac{1}{5}\log |x+2|+C\]
In order to find value of a and b we have to evaluate the integral
$\displaystyle \int \frac{dx}{(x+2)(x^{2}+1)}$ at first.
For that we are using method of partial fractions.
$\displaystyle \frac{1}{(x+2)(x^{2}+1)}= \frac{A}{x+2}+\frac{Bx+C}{x^2+1}\\\\ \Rightarrow 1=\left [\frac{A}{x+2}+\frac{Bx+C}{x^2+1} \right ](x+2)(x^{2}+1) \\\\ \Rightarrow 1=A(x^{2}+1)+(Bx+C)(x+2)$
Now we have to find values of A,B and C,for that
$\displaystyle \mathbf{Put\; x=-2}\\\Rightarrow 1=A((-2)^{2}+1)\Rightarrow 1=5A \; \mathbf{and}\; A=\frac{1}5{}\\ \\ \mathbf{By \; comparing \; coefficients\: of \; x^{2}}:0=A+B\Rightarrow B=-\frac{1}{5} \\\\ \mathbf{By \; comparing \; coefficients\: of \; x}:0=2B+C \Rightarrow C=-2B=\frac{2}{5} \\\\$
Now by substituting values of A,B and C we will get
\[\frac{1}{(x+2)(x^{2}+1)}= \frac{\frac{1}{5}}{x+2}+\frac{-\frac{1}{5}x+\frac{2}{5}}{x^2+1}\\\\\]
And
\[\begin{align*} \int \frac{dx}{(x+2)(x^{2}+1)}&= \int \frac{\frac{1}{5}}{x+2}\; dx+\int \frac{-\frac{1}{5}x+\frac{2}{5}}{x^2+1}\; dx \\ &= \frac{1}{5}\int \frac{dx}{x+2}-\int \left [\frac{1}{5} \frac{x}{x^{2}+1}+ \frac{2}{5}\frac{1}{x^{2}+1} \right ]dx\\ &= \frac{1}{5}\int \frac{dx}{x+2}-\frac{1}{5}\int \frac{x}{x^{2}+1} dx+ \frac{2}{5}\int \frac{1}{x^{2}+1} dx \end{align*}\]
Consider $\displaystyle \int \frac{x}{x^{2}+1}\; dx$ :
$\displaystyle \mathbf{Put \; x^{2}+1=u}\\ \mathbf{And \; differentiating \; w.r.t \; x .,2x\; dx=du\Rightarrow x\; dx=\frac{du}{2}} \\ \boldsymbol{\Rightarrow \int \frac{x}{x^{2}+1}\; dx=\int \frac{1}{u} \frac{du}{2}=\frac{1}{2}\log |u|+C }$
Hence
\[\begin{align*} \int \frac{dx}{(x+2)(x^{2}+1)} &=\frac{1}{5}\int \frac{dx}{x+2}-\frac{1}{5}\int \frac{x}{x^{2}+1} dx+ \frac{2}{5}\int \frac{1}{x^{2}+1} dx \\ &=\frac{1}{5}\log |x+2| -\frac{1}{5} \left [ \frac{1}{2} \log |x^{2}+1| \right ]+\frac{2}{5}\tan ^{-1}x+C\\ &=\frac{1}{5}\log |x+2| -\frac{1}{10} \left [ \log |x^{2}+1| \right ]+\frac{2}{5}\tan ^{-1}x+C \\ &=-\frac{1}{10} \log |x^{2}+1| +\frac{2}{5}\tan ^{-1}x+\frac{1}{5}\log |x+2|+C \end{align*}\\ \therefore \int \frac{dx}{(x+2)(x^{2}+1)}= -\frac{1}{10} \log |x^{2}+1| +\frac{2}{5}\tan ^{-1}x+\frac{1}{5}\log |x+2|+C\]
Hence \[a=-\frac{1}{10} \; \; \; \; \; \, \mathbf{and}\; \; \; \; \; b=\frac{2}{5}.\]
😀😀😀