Example questions:
$ \displaystyle \int \frac{2x}{x^2+2x-4} \; \mathrm{d}x$
$ \displaystyle \int \frac{x^2}{x^2+2x-4} \; \mathrm{d}x$
$ \displaystyle \int \frac{1}{x^3-x} \; \mathrm{d}x$
$\displaystyle \int \frac{2x}{x^2+2x-4} \; \mathrm{d}x \\
= \displaystyle \int \frac{2x+2-2}{x^2+2x-4} \; \mathrm{d}x \\
= \displaystyle \int \frac{2x+2}{x^2+2x-4} - \frac{2}{x^2+2x-4} \; \mathrm{d}x \\
= \displaystyle \ln |x^2+2x-4| - 2 \int \frac{1}{(x+1)^2-5} \; \mathrm{d}x$
$=$ $\displaystyle \ln |x^2+2x-4| - \frac{1}{\sqrt{5}} \ln \left | \frac{x+1-\sqrt{5}}{x+1+\sqrt{5}} \right | + C$
$\displaystyle \int \frac{x^2}{x^2+2x-4} \; \mathrm{d}x \\
= \displaystyle \int 1 - \frac{2x-4}{x^2+2x-4} \; \mathrm{d}x \\
= \displaystyle \int 1 - \frac{2x+2}{x^2+2x-4} + \frac{6}{x^2+2x-4} \; \mathrm{d}x \\
= \displaystyle \int 1 - \frac{2x+2}{x^2+2x-4} + \frac{6}{(x+1)^2 - 5} \; \mathrm{d}x$
$=$ $\displaystyle x - \ln | x^2 + 2x - 4| + \frac{3}{\sqrt{5}} \ln \left | \frac{x+1-\sqrt{5}}{x+1+\sqrt{5}} \right | + C$
$\displaystyle \int \frac{1}{x^3-x} \; \mathrm{d}x \\
= \displaystyle \int \frac{1}{(x-1)(x)(x+1)} \; \mathrm{d}x \\
= \displaystyle \int \frac{1}{2(x-1)} - \frac{1}{x} + \frac{1}{2(x+1)} \; \mathrm{d}x$
$=$ $\displaystyle \frac{1}{2} \ln |x-1| - \ln |x| + \frac{1}{2} \ln |x+1| + C$
In examples 8.1 and 8.2 we saw how to tackle integrals such as $\displaystyle \int \frac{x}{x^2-4} \; \mathrm{d}x$ (of the form $\displaystyle \frac{f'(x)}{f(x)}$), $\displaystyle \int \frac{1}{x^2-4} \; \mathrm{d}x$ (of the form $\displaystyle \frac{1}{x^2-a^2}$) and $\displaystyle \int \frac{1}{x^2+2x-4} \; \mathrm{d}x$ (by completing the square). Unfortunately, we can't quite directly apply any of those techniques for our new example $ \displaystyle \int \frac{2x}{x^2+2x-4} \; \mathrm{d}x$ .
We have also seen how to obtain $f'(x)$ in example 8.1 by multiplying terms of the type $\frac{a}{a}$. For our current question, if we let $f(x) = x^2+2x-4$, then $f'(x) = 2x+2$. We already have $2x$ on our numerator so we will need to introduce $+2$. Hence, rather then multiplication by 1, we will add 0 to our expression so as not to change it: $0$ in the form of $+2-2$.
We proceed to split up our fraction into two: $\displaystyle \frac{2x+2}{x^2+2x-4}$ is now of the form $\displaystyle \frac{f'(x)}{f(x)}$ while $\displaystyle \frac{2}{x^2+2x-4}$ can be integrated by completing the square and applying the relevant formula from MF26.
The second example $\displaystyle \int \frac{x^2}{x^2+2x-4} \; \mathrm{d}x$ is even more complicated than the first. In particular, the key characteristic is that it is an improper fraction. We simplify it by performing long division:
Long division gives us the expression $\displaystyle 1 + \frac{-2x+4}{x^2+2x-4} = 1 - \frac{2x-4}{x^2+2x-4}$. $1$ is easily integrated to $x$, while we tackle the fraction $\displaystyle \frac{2x-4}{x^2+2x-4}$ by a combination of obtaining $f'(x)$, splitting up the fraction further and completing the square. This is similar to what we have done in the first example.
For the last example, the cubic polynomial in the denominator means that all techniques discussed so far isn't applicable. For fraction, we have yet another useful algebraic technique: partial fractions.
We can split $\displaystyle \frac{1}{x^3-x} = \frac{1}{(x-1)(x)(x+1)} = \frac{A}{x-1} + \frac{B}{x} + \frac{C}{x+1}$. Solving for $A, B$ and $C$ (the cover up rule is especially useful) gives us $\displaystyle \frac{1}{2(x-1)} - \frac{1}{x} + \frac{1}{2(x+1)}$. Each of the terms are then easy to integrate to give us the answer.