<s>[INST] Finding partial fractions expansions mentally On a problem on a test, my students were asked to find $\displaystyle\int\frac{6x^4-7x^3-13x-6}{x^3-2x^2} dx$,
and one student began by writing $\displaystyle\int\frac{6x^4-7x^3-13x-6}{x^2(x-2)} dx=\int\left(\frac{3}{x^2}+6x+\frac{2}{x-2}+\frac{8}{x}+5\right)dx$.
My question is how someone can get this result without doing any division or partial fraction decomposition -- what techniques can be used to get this?
 [/INST] The residue theorem, for instance. If $f(x)$ is a polynomial with degree $4$,
$$ g(x)=\frac{f(x)}{x^2(x-2)} = \frac{A}{x^2}+\frac{B}{x}+\frac{C}{x-2}+D+Ex \tag{1}$$
is granted, and 
$$ A=\text{Res}\left(x\cdot g(x),x=0\right),\quad B = \text{Res}(g(x),x=0),\quad C=\text{Res}(g(x),x=2)\tag{2} $$
are straightforward to compute through simple limits.  Then, by computing
$$ g(x)-\frac{A}{x^2}-\frac{B}{x}-\frac{C}{x-2}, \tag{3} $$
that we know in advance to be a polynomial with degree $\leq 1$, we recover $D$ and $E$, too.
As an alternative, it is enough to notice that:
$$\begin{eqnarray*}6x^4-7x^3-13x-6 &=& 6x\cdot x^2(x-2)+5x^3-13x-6\\&=&6x\cdot x^2(x-2)+5\cdot x^2(x-2)+10x^2-13x-6 \end{eqnarray*}$$
and:
$$ 10x^2-13x-6 = 10\cdot x^2 + 3(x-2)-10 x,\quad \frac{1}{x(x-2)}=\frac{1}{2}\left(\frac{1}{x-2}-\frac{1}{x}\right).$$
</s>