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$$
 A: With $x=t+1$
\begin{align}
&\ \frac{5x^4-21x^3+40x^2-37x+14}{(x-2)(x^2-2x+2)^2}
= \frac{5t^4-t^3+7t^2+1}{(t-1)(t^2+1)^2}
= \frac{A}{t-1}+ {P(t)}
\end{align}
where $A = \lim_{t\to 1}\frac{5t^4-t^3+7t^2+1}{(t^2+1)^2}=3
$ and
\begin{align}
P(t)= &\ \frac{5t^4-t^3+7t^2+1}{(t-1)(t^2+1)^2}
-\frac{3}{t-1}\\
= &\ \frac{2t^3+t^2+2t+2}{(t^2+1)^2}
=\frac{2t(t^2+1)+(t^2+1)+1}{(t^2+1)^2}
= \frac{2t+1}{t^2+1}+ \frac{1}{(t^2+1)^2}\\
\end{align}
Thus, the integral becomes
$$I=\int \frac3{t-1}+ \frac{2t+1}{t^2+1}+ \frac{1}{(t^2+1)^2}\ dt
$$
A: If you're going for a purely partial fraction decomposition approach, then I'm afraid there isn't much you can do to expedite the process. Partial fraction decomposition is just a naturally tedious and long-winded thing to do.
$$\frac {5x^4-21x^3+40x^2-37x+14}{(x-2)(x^2-2x+2)^2}=\frac A{x-2}+\frac {Bx+C}{x^2-2x+2}+\frac {Dx+E}{(x^2-2x+2)^2}\tag1$$
Clear the fraction to get
$$5x^4-21x^3+40x^2-37x+14=A(x^2-2x+2)^2+(Bx+C)(x-2)\times\ldots\\(x^2-2x+2)+(Dx+E)(x-2)\tag2$$
There is a slightly faster way to obtain most of the coefficients than expanding the right-hand side and comparing the values. First, set $x=2$ and observe that the second and third terms of the right-hand side vanish.
$$12=4A\qquad\implies\qquad A=3\tag3$$

 Note that another way to find $A$ would've been to take the limit of the left-hand side of $(1)$ ignoring the $x-2$ term$$A=\lim\limits_{x\to2}\frac {5x^4-21x^3+40x^2-37x+14}{(x^2-2x+2)^2}=3$$This is essentially the same as the way I've shown above, just in less steps.

Next, set the quadratic equal to zero and observe how the first and second terms vanish. To do so, no need to actually solve the quadratic, observe that $x^2=2x-2$ and replace all occurrences of even powers with that.
$$5(2x-2)^2-21x(2x-2)+40(2x-2)-37x+14=(Dx+E)(x-2)$$
After much simplification, and replacing any resulting $x^2$ terms with $2x-2$ after expanding, you should arrive
$$x-2=(Dx+E)(x-2)\qquad\implies\qquad(D, E)=(0, 1)\tag4$$
Unfortunately, I do not know of a way to solve for $B$ and $C$ with a single substitution. Replace $A$, $D$, and $E$ in $(2)$ with the values derived from $(3)$ and $(4)$ and simplify.
$$(2x-1)(x-2)(x^2-2x+2)=(Bx+C)(x-2)(x^2-2x+2)$$
Clearly, $B=2$ and $C=-1$. Putting everything together gives

$$\frac {5x^4-21x^3+40x^2-37x+14}{(x-2)(x^2-2x+2)^2}=\frac 3{x-2}+\frac {2x-1}{x^2-2x+2}+\frac 1{(x^2-2x+2)^2}$$

A: 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}
$$
