# Integrating a Rational Function

I am studying for a test and I am trying to evauate the integral below. I know how to simplify it with partial fractions, but when I try to solve it, I cannot seem to find a substitution that will simplify it enough to solve in reasonably quick . I plugged it into wolfram and as usual it doesn't give a quick way either. If anybody has a way this integral can be solved quickly, as there will be a time crunch on my test. $$\int\frac{x^3+x+2}{x^4+2x^2+1}dx$$

-

From partial fractions and two variable substitutions \begin{align} \int \frac{x^3+x+2}{x^4+2x^2+1}dx &= \int\frac{x}{x^2+1}dx + 2\int\frac{1}{x^2+1}\frac{1}{x^2+1}dx \\ &= \frac{1}{2}\int\frac{du}{u}+\int\frac{1}{(\tan v)^2+1}dv \end{align}

where $u=x^2+1$ and $v=\arctan x$ (recall that $\frac{d}{dx}\arctan x = \frac{1}{1+x^2}$). Now since $\tan^2v+1 = \sec^2 v = 1/\cos^2 v$,

\begin{align} \int \frac{x^3+x+2}{x^4+2x^2+1}dx &= \frac{\ln u}{2} + 2\int \cos^2(v)\, dv \\ &= \frac{\ln u}{2}+2\left(\frac{\sin v \cos v}{2} +\frac{v}{2}\right) \\ &= \frac{\ln \left(x^2+1\right)}{2}+\sin \left(\arctan x\right) \cos \left(\arctan x\right) +\arctan x \\ &= \frac{1}{2}\ln \left(x^2+1\right) + \frac{x}{x^2+1} + \arctan x \end{align} Hope this helps.

-

I think the integral can be solved in a very easy way. \begin{align} \int\frac{x^3+x+2}{x^4+2x^2+1}dx&=\int\frac{x^3+x}{x^4+2x^2+1}dx+\int\frac{2}{x^4+2x^2+1}dx\\ &=\int\frac{x^3+x}{x^4+2x^2+1}dx+\int\frac{2}{(x^2+1)^2}dx. \end{align} In the RHS part, for the left integral uses substitution $u=x^4+2x^2+1\;\Rightarrow\;du=4(x^3+x)\,dx$ and for the right integral uses substitution $x=\tan\theta\;\Rightarrow\;dx=\sec^2\theta\;d\theta$. Therefore \begin{align} \int\frac{x^3+x+2}{x^4+2x^2+1}dx&=\int\frac{1}{4u}du+\int\frac{2\sec^2\theta}{(\tan^2\theta+1)^2}d\theta\\ &=\frac{1}{4}\ln\,|u|+\text{C}+2\int\frac{\sec^2\theta}{\sec^4\theta}d\theta\\ &=\frac{1}{4}\ln\,\left|x^4+2x^2+1\right|+2\int\cos^2\theta\;d\theta+\text{C}. \end{align} The rest should be easy to be solved. Just make sure you make appropriate limit for the integral when use substitution method.

$$\text{# }\mathbb{Q.E.D.}\text{ #}$$

-

Try rewriting your integral like this:

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

-
I did that and decomposed it with partial fractions, the problem I have is picking a good substitution thereafter to solve it easily. –  Dick Feb 24 '13 at 2:34
The integral splits into $\int \frac{x}{x^2+1} dx + \int \frac{2}{(x^2+1)^2} dx$. Which integral are you having problems with? –  fixedp Feb 24 '13 at 2:38
The second one, is there a better substitution than x = tan(u)? –  Dick Feb 24 '13 at 2:44
If you know about integration by parts, that would be easier. If not, $x=\tan(u)$ will give you the correct answer after a bit of work. Both methods can be found here: math.stackexchange.com/questions/35924/integral-of-frac11x22 –  fixedp Feb 24 '13 at 2:47
Nice link, thanks. –  Dick Feb 24 '13 at 2:55