<s>[INST] How to solve long integration by partial fraction decomposition problems faster? Some problems are just too time consuming for short exam times what is the fastest way to solve problems like this one for example $$\int \frac{5x^4-21x^3+40x^2-37x+14}{(x-2)(x^2-2x+2)^2}dx$$
 [/INST] There are a few answers in here already, but I hope mine can contribute something. Except for very simple cases, there's no fastest partial fractions decomposition method. You have to decide which method(s) is(are) best for the case at hand. Although the algebraic method (matching coefficients) always works, the cover-up method (for distinct real roots) and the derivative method (for dealing if roots of multiplicity greater than one) are very useful to have in mind. As we'll see with my take on your example, a combination of methods is often warranted.
First we set up our partial fractions and eliminate the denominators to get
$$
\begin{split}
5x^4 - 21x^3 + 40x^2 - 37x + 14 &= A(x^2 - 2x + 2)^2 + (Bx + C)(x-2)(x^2 - 2x + 2)\\
&\phantom= +(Dx + E)(x-2).
\end{split}\tag1 \label{1}
$$
To solve for $A$, there's not much you can do other than direct evaluation by setting $x=2$, which will give you
$$
4A = 12 \Longrightarrow A = 3.
$$
Knowing $A$, $B$ can be easily calculated by noticing that the right-hand side of \eqref{1} can be expanded as
$$
5x^4 + \mathcal{O}(x^3) = (3 + B)x^4 + \mathcal{O}(x^3), \tag2 \label{2}
$$
where the big-O notation is used to represent terms proportional to $x^3$ at the most. Dividing both sides of \eqref{2} by $x^4$ and taking the limit as $x\to\infty$
$$
\begin{split}
\lim_{x\to\infty} 5 + {\mathcal{O}(x^3) \over x^4} &= \lim_{x\to\infty} 3 + B + {\mathcal{O}(x^3) \over x^4}\\
B &= 2.
\end{split}
$$
There are no clever ways to solve directly for $C$, $D$ or $E$, but if we expand the RHS of \eqref{1} we can find the last three unknowns by inspection. Substituting the known values of $A$ and $B$, we have
$$
- x^3 + 4x^2 -5x + 2 = C(x^3 -4x^2 + 6x - 4) + D(x^2 - 2x) + E(x - 2) \tag{3} \label{3}
$$
and it's obvious that $C = -1$.
Replacing $C$ by its value in \eqref{3} yields
$$
x - 2 = D(x^2 - 2x) + E(x - 2)
$$
from where it's evident that $D = 0$ and $E = 1$.
Finally
$$
{5x^4 - 21x^3 + 40x^2 - 37x + 14 \over (x-2)(x^2 - 2x + 2)^2} = {3 \over x-2} + {2x - 1 \over x^2 - 2x + 2} + {1 \over (x^2 - 2x + 2)^2}
$$
</s>