# How to solve certain types of integrals

I'm asking for a walk through of integrals in the form: $$\int \frac{a(x)}{b(x)}\,dx$$ where both $a(x)$ and $b(x)$ are polynomials in their lowest terms. For instance $$\int \frac{x^3+2x}{x^2+1}\,dx$$

Is there a trick to doing these? or will I have to integrate by a clever substitution?

• There's a pretty common general method to solve these, see for example here: people.clarkson.edu/~sfulton/ma132/parfrac.pdf – Jef L May 25 '15 at 12:35
• Divide the numerator by denominator to make the numerator linear. Then bring the differentiated form of the denominator in the numerator. And then use proper substitution. – user142971 May 25 '15 at 12:35
• Look up "integration by partial fractions". There's a general approach, though it is rather tedious to apply. – Gregory Grant May 25 '15 at 12:36
• I once saw in a book a complete algorithmic description (and not just qualitative, I mean a true algorithm) for rational integrals. I don't recommend following it though, I think it's just there for existence purposes. Usually it's just divide + partial fractions anyways. – GPerez May 25 '15 at 12:51
• "Solve" is not the most appropriate word here. "Evaluate" fits better. "Solve" seems to get used by non-mathematicians as a catch-all term when they don't know any other word. "Equation" is another one. ${}\qquad{}$ – Michael Hardy May 25 '15 at 13:09

The first step is generally to divide out the integrand so as to get a polynomial plus a rational function whose numerator has lower degree than its denominator. Here you get

$$\frac{x^3+2x}{1+x^2}=x+\frac{x}{x^2+1}\;.$$

Integrating the $x$ term (and, more generally, the polynomial quotient) is easy, so we’ve reduced the problem to integrating something of the form $\frac{p(x)}{q(x)}$, where $p(x)$ and $q(x)$ are polynomials, and the degree of $p(x)$ is less than the degree of $q(x)$. The general solution for such problems is partial fractions; here, however, we’re more fortunate, because the numerator $x$ is a constant multiple of the derivative of the denominator. If you substitute $u=x^2+1$, you find that $du=2x\,dx$, so that $x\,dx=\frac12du$, and

$$\int\frac{x}{x^2+1}\,dx=\frac12\int\frac{du}u\;,$$

which is a standard, basic integral. I would not call this a clever substitution: recognizing that the numerator of a fraction is a constant multiple of the derivative of the denominator is a standard technique.

Suppose that the original numerator had been $x^3+x+2$. Again we do the division to get a polynomial plus a ‘proper’ rational function:

$$\frac{x^3+x+2}{x^2+1}=x+\frac2{x^2+1}\;.$$

This time you should recognize that $\frac2{x^2+1}$ is just twice the derivative of $\tan^{-1}x$, again a standard integration.

Finally, suppose that the original fraction had been

$$\frac{x^3+x+1}{x^2+2x}=x+\frac{1-x}{x^2+2x}\;.$$

This time you might as well simply reduce the remaining fraction to partial fractions:

$$\frac{1-x}{x(x+2)}=\frac{A}x+\frac{B}{x+2}\;,$$

so $A(x+2)+Bx=1-x$, $(A+B)x+2A=1-x$, $A+B=-1$, and $2A=1$, so $A=\frac12$, and $B=-\frac32$. Thus,

$$\frac{1-x}{x^2+2x}=\frac12\left(\frac1x-\frac3{x+2}\right)\;,$$

leaving you with two easy integrations.

To integrate a rational function there are two standard methods:

The latter does not require finding the roots of the denominator. See example here.

• +1 for mentioning the Hermite method, which can be useful when the polynomials get more complicated – Lonidard May 25 '15 at 13:20
• Ostrogradski-Hermite method work only when denominator has multiple or repetead roots, isn't it? in this case doesn't work – Lucas May 25 '15 at 16:01
• @Lucas That's right! In this case it's enough to integrate by partial-fractions. – Américo Tavares May 25 '15 at 18:04
• @bharb Thanks! ${}{}$ – Américo Tavares May 25 '15 at 18:05

Generally, you just try the long division if degree of $a(x)$ is higher than degree of $b(x)$. And for this particular example, write $\dfrac{x^3+2x}{1+x^2} = x + \dfrac{x}{1+x^2}$. Can you take it from here?

• yeah that makes sense, but what if the degree of $b(x)$ is greater than that of $a(x)$? – TobyStack May 25 '15 at 12:41
• Then you would do a substitution or integration by parts... – DeepSea May 25 '15 at 12:42

The easiest way is to apply the long division, but you can make substitution also:

let $u=x^2+1\Rightarrow du=2x dx$

Therefore: $\int \frac{x^3+2x}{x^2+1}dx=\frac{1}{2}\int\frac{u+1}{u}du=\frac{u+ln(u)}{2}+C=\frac{x^2+1+ln(x^2+1)}{2}+C=\frac{x^2+ln(x^2+1)}{2}+C$

I don't understand if @mathlove is the first who gives an answer why others give the same answer? Where is originality?