# 007B Sample Midterm 2, Problem 5 Detailed Solution

Evaluate the integral:

$\int {\frac {4x}{(x+1)(x^{2}+1)}}~dx$ Background Information:
Through partial fraction decomposition, we can write
${\frac {1}{(x+1)(x^{2}+1)}}={\frac {A}{x+1}}+{\frac {Bx+C}{x^{2}+1}}$ for some constants $A,B.$ Solution:

Step 1:
We need to use partial fraction decomposition for this integral.
To start, we let
${\frac {4x}{(x+1)(x^{2}+1)}}={\frac {A}{x+1}}+{\frac {Bx+C}{x^{2}+1}}.$ Multiplying both sides of the last equation by  $(x+1)(x^{2}+1),$ we get
$4x=A(x^{2}+1)+(Bx+C)(x+1).$ Step 2:
If we let  $x=-1,$ the last equation becomes  $-4=2A.$ So,  $A=-2.$ If we let  $x=0,$ then we get  $0=A+C.$ Thus,  $C=-A=2.$ Finally, if we let  $x=1,$ we get  $4=2A+2B+2C.$ Plugging in  $A=-2$ and  $C=2,$ we get  $B=2.$ So, in summation, we have
${\frac {4x}{(x+1)(x^{2}+1)}}={\frac {-2}{x+1}}+{\frac {2x+2}{x^{2}+1}}.$ Step 3:
Now, we have

${\begin{array}{rcl}\displaystyle {\int {\frac {4x}{(x+1)(x^{2}+1)}}~dx}&=&\displaystyle {\int {\frac {-2}{x+1}}~dx+\int {\frac {2x+2}{x^{2}+1}}~dx}\\&&\\&=&\displaystyle {\int {\frac {-2}{x+1}}~dx+\int {\frac {2x}{x^{2}+1}}~dx+\int {\frac {2}{x^{2}+1}}~dx}\\&&\\&=&\displaystyle {\int {\frac {-2}{x+1}}~dx+\int {\frac {2x}{x^{2}+1}}~dx+2\arctan(x).}\end{array}}$ For the remaining integrals, we use  $u$ -substitution.
For the first integral, we substitute  $u=x+1.$ For the second integral, the substitution is  $t=x^{2}+1.$ Then, we integrate to get

${\begin{array}{rcl}\displaystyle {\int {\frac {4x}{(x+1)(x^{2}+1)}}~dx}&=&\displaystyle {\int {\frac {-2}{u}}~du+\int {\frac {1}{t}}~dt+2\arctan(x)}\\&&\\&=&\displaystyle {-2\ln |u|+\ln |t|+2\arctan(x)+C}\\&&\\&=&\displaystyle {-2\ln |x+1|+\ln |x^{2}+1|+2\arctan(x)+C.}\end{array}}$ $-2\ln |x+1|+\ln |x^{2}+1|+2\arctan(x)+C$ 