# Thread: Rational integral

1. ## Rational integral

Solve $\displaystyle \displaystyle\int\frac{2x^3+3x^2+x-1}{(x+1)(x^2+2x+2)^2}\,dx$ by not using partial fractions.

I liked this particular integral, I solved it on another forum to show that sometimes we can avoid the annoying algebra when doing the partial fractions.

2. $\displaystyle \displaystyle \int \frac{2x^3 + 3x^2 + x - 1 }{(x+1)(x^2 + 2x+2)^2} ~dx$

$\displaystyle \displaystyle =\int \frac{(x+1)(2x^2 + x ) - 1 }{(x+1)(x^2 + 2x+2)^2} ~dx$

$\displaystyle \displaystyle = \int \frac{(x+1)(2x^2 + 2x+1 ) - ((x+1)^2 + 1) }{(x+1)(x^2 + 2x+2)^2} ~dx$

$\displaystyle \displaystyle = \int \frac{ 2x^2 + 2x + 1 }{ (x^2 + 2x + 2 )^2 } ~dx - \int \frac{dx}{(x+1)(x^2 + 2x + 2 ) }$

$\displaystyle \displaystyle = \int \frac{ (x^2 + 2x + 2 ) + (x^2 - 1) }{ (x^2 + 2x + 2 )^2 } ~dx - \int \frac{dx}{(x+1)(x^2 + 2x + 2 ) }$

$\displaystyle \displaystyle = \int \frac{ dx}{ x^2 + 2x + 2 } + \int \frac{(x-1)(x+1)}{(x+1)(x^2 + 2x + 2 )^2 } ~dx - \int \frac{dx}{(x+1)(x^2 + 2x + 2 ) }$

Sub. $\displaystyle \displaystyle x+1 = 1/t$ on the third integral , we have

$\displaystyle \displaystyle \int \frac{dx}{(x+1)(x^2 + 2x + 2 ) } = - \int \frac{t~dt}{t^2 + 1 }$

$\displaystyle = - \frac{1}{2} \ln(t^2+ 1 ) + C = \ln|1+x| - \frac{1}{2} \ln(x^2 + 2x + 2) + C$

For the second integral , use integration by parts ,

$\displaystyle \displaystyle \int \frac{(x-1)(x+1)}{ (x^2 + 2x + 2 )^2 } ~dx$

$\displaystyle \displaystyle = - \frac{1}{2} ~ \frac{x-1}{x^2+2x+2} + \frac{1}{2}~\int \frac{dx}{x^2 + 2x + 2 }$

Therefore ,

$\displaystyle \displaystyle \int \frac{2x^3 + 3x^2 + x - 1 }{(x+1)(x^2 + 2x+2)^2} ~dx$

$\displaystyle \displaystyle = \frac{3}{2}~ \int \frac{ dx}{ x^2 + 2x + 2 } - \frac{1}{2} ~ \frac{x-1}{x^2+2x+2} - \ln|1+x| + \frac{1}{2} \ln(x^2 + 2x + 2) + C'$

$\displaystyle \displaystyle = \frac{3}{2} \tan^{-1}(x+1) - \frac{1}{2} ~ \frac{x-1}{x^2+2x+2} - \ln|1+x| + \frac{1}{2} \ln(x^2 + 2x + 2) + C'$

3. I observe that:

$\displaystyle 2x^3+3x^2+x-1 = (x+1)(x^2+2x+2)-(x^2+2x+2)+(x-1) (x+1)^2$

So we have:

\displaystyle \begin{aligned} \displaystyle\int\frac{2x^3+3x^2+x-1}{(x+1)(x^2+2x+2)^2}\;dx &=\int\frac{(x+1)(x^2+2x+2)-(x^2+2x+2)+(x-1) (x+1)^2}{(x+1)(x^2+2x+2)^2}\;dx \\ & = \int \frac{1}{x^2+2x+2}-\frac{1}{(x+1)(x^2+2x+2)}+\frac{x^2-1}{(x^2+2x+2)^2}\;{dx} \\ & = \int \frac{1}{(x+1)^2+1} \;{dx}-\int\frac{(x^2+2x+2)-(x+1)^2}{(x+1)(x^2+2x+2)}\;{dx}+\int \frac{x^2-1}{(x^2+2x+2)^2}\;{dx} \\ & = \arctan(x+1)-\int\frac{1}{x+1}\;{dx}+\int\frac{(x+1)}{(x+1)^2+1 }\;{dx}+\int \frac{x^2-1}{(x^2+2x+2)^2}\;{dx} \\ & = \arctan(x+1)-\ln(x+1)+\frac{1}{2}\int\frac{2x+2}{x^2+2x+2}\;{dx }+\int \frac{x^2-1}{(x^2+2x+2)^2}\;{dx}} \\ & = \arctan(x+1)-\ln(x+1)+\frac{1}{2}\ln(x^2+2x+2)+\int \frac{x^2-1}{(x^2+2x+2)^2}\;{dx} \\ & \end{aligned}

Where for the last integral we use the substitution $\displaystyle t = (x+1)$ to get:

\displaystyle \begin{aligned} \int \frac{x^2-1}{(x^2+2x+2)^2}\;{dx} & = \int\frac{(x+1)(x-1)}{[(x+1)^2+1]^2}\;{dx} = \int\frac{t^2-2t}{(t^2+1)^2}\;{dt}\\& = \int\frac{t^2}{(t^2+1)^2}\;{dt}-\int\frac{2t}{(t^2+1)^2}\;{dt}\\& = \frac{1}{t^2+1}+\int\frac{t^2}{(t^2+1)^2}\;{dt}\\& \end{aligned}

Letting $\displaystyle t = \tan{u}$ in the remaining integral we have:

\displaystyle \begin{aligned} \int\frac{t^2}{(t^2+1)^2}\;{dt} & = \int\frac{\tan^2{u}\sec^2{u}}{\sec^4{u}}\;{du} = \int \sin^2{u}\;{du} = \frac{1}{2}\;{u}-\frac{1}{4}\sin{2u}+k \\& = \frac{1}{2}\arctan{t}-\frac{1}{4}\sin\left(2\arctan{t}\right)+k = \frac{1}{2}\arctan{t}-\frac{t}{2(t^2+1)}+k \\& = \frac{1}{2}\arctan(x+1)-\frac{x+1}{2(x^2+2x+2)}+k \end{aligned}

Thus

$\displaystyle \displaystyle\int\frac{2x^3+3x^2+x-1}{(x+1)(x^2+2x+2)^2}\;dx$ $\displaystyle \displaystyle = \frac{3}{2}\arctan(x+1)+\ln\left|\frac{1}{x+1}\rig ht|+\frac{1}{2}\ln\left|(x+1)^2+1\right|$ $\displaystyle \displaystyle -\frac{1}{2}\left(\frac{x+1}{(x+1)^2+1}\right)+\lef t(\frac{1}{(x+1)^2+1}\right)+k$

4. good! pretty different solutions from the one i have:

consider $\displaystyle \displaystyle\int{\frac{{{t}^{2}}}{{{\left( {{t}^{2}}+1 \right)}^{2}}}\,dt}=\int{t\left( -\frac{1}{2\left( {{t}^{2}}+1 \right)} \right)'\,dt}=-\frac{t}{2\left( {{t}^{2}}+1 \right)}+\frac12\int{\frac{dt}{{{t}^{2}}+1}},$ (1); now from $\displaystyle \displaystyle\int\frac{dt}{t(t^2+1)^2}$ put $\displaystyle u=\dfrac1{t^2}+1$ and the integral becomes $\displaystyle \displaystyle-\frac12\int\frac{u-1}{u^2}\,du,$ (2).

on the original integral put $\displaystyle t=x+1$ then

\displaystyle \begin{aligned} \int{\frac{2{{x}^{3}}+3{{x}^{2}}+x-1}{(x+1){{\left( {{x}^{2}}+2x+2 \right)}^{2}}}\,dx}&=\int{\frac{2{{x}^{3}}+3{{x}^{ 2}}+x-1}{(x+1){{\left( {{(x+1)}^{2}}+1 \right)}^{2}}}\,dx} \\ & =\int{\frac{2{{t}^{3}}-3{{t}^{2}}+t-1}{t{{\left( {{t}^{2}}+1 \right)}^{2}}}\,dt} \\ & =\int{\frac{{{t}^{2}}}{{{\left( {{t}^{2}}+1 \right)}^{2}}}\,dt}-3\int{\frac{t}{{{\left( {{t}^{2}}+1 \right)}^{2}}}\,dt}+\int{\frac{dt}{{{t}^{2}}+1}}-\int{\frac{dt}{t{{\left( {{t}^{2}}+1 \right)}^{2}}}}, \end{aligned}

from (1) and (2) the latter equals

$\displaystyle \displaystyle-\frac{t}{2\left( {{t}^{2}}+1 \right)}+\frac32\arctan (t)+\frac{3}{2\left( {{t}^{2}}+1 \right)}+\frac{1}{2}\left[ \ln \left(\frac{{{t}^{2}}+1}{{{t}^{2}}}\right)+\frac{{ {t}^{2}}}{{{t}^{2}}+1} \right]+k,$

and the original integral equals

$\displaystyle \displaystyle-\frac{x+1}{2\left( {{(x+1)}^{2}}+1 \right)}+\frac{3}{2}\arctan (x+1)+\frac{3}{2\left( {{(x+1)}^{2}}+1 \right)}+\frac{1}{2}\left[ \ln \left( \frac{{{(x+1)}^{2}}+1}{{{(x+1)}^{2}}} \right)+\frac{{{(x+1)}^{2}}}{{{(x+1)}^{2}}+1} \right]+k.$

5. What about letting $\displaystyle x + 1 = \tan \theta$ right away. The integral becomes

$\displaystyle \displaystyle \int \dfrac{2 \tan^3 \theta - 3 \tan^2 \theta + \tan \theta - 1}{\tan \theta \sec^2 \theta} d \theta$

or

$\displaystyle \displaystyle \int 2 \sin^2 \theta - 3 \sin \theta \cos \theta + \cos^2 \theta - \frac{\cos^3 \theta }{\sin \theta }\; d \theta$

or

$\displaystyle \displaystyle \int \frac{3}{2} - \frac{1}{2} \cos 2 \theta - 2 \sin \theta \cos \theta - \dfrac{\cos \theta}{\sin \theta} \; d \theta$

Integrating gives

$\displaystyle \frac{3}{2} \theta - \frac{1}{4} \sin 2 \theta - \sin^2 \theta - \ln \sin \theta + c$

Then backsubstitute noting that

$\displaystyle \theta = \tan^{-1}(x+1),\;\; \sin \theta = \dfrac{x+1}{\sqrt{x^2+2x+2}},\;\; \cos \theta = \dfrac{1}{\sqrt{x^2+2x+2}}.$