<s>[INST] What technique turns $\frac{x}{(x-2)^2(x+1)}$ into $-\frac{1}{9x+9}+\frac{1}{9x-18}+\frac{2}{3(x-2)^2}$? I found this:

Let's rewrite the integrand so that it's easier to integrate:
  $$\dfrac{x}{(x-2)^2(x+1)} = -\dfrac{1}{9x+9}+\dfrac{1}{9x-18}+\dfrac{2}{3(x-2)^2}$$

I see how the expressions are equal, but I don't know how to get from the left to the right. There must be a technique that is used; could you tell me what the technique is called so I can read more about it or maybe you could explain it to me?
Thanks for your help.
 [/INST] The technique that is being used is called partial fraction decomposition. You'll get "tons" of hits if you Google the phrase.
As applied to this particular question, first note that
$$\dfrac{x}{(x-2)^2(x+1)} = -\dfrac{1}{9x+9}+\dfrac{1}{9x-18}+\dfrac{2}{3(x-2)^2}$$
$$= -\frac 19\cdot \frac 1{x + 1} + \frac 19 \cdot \frac{1}{x-2} + \frac 23\cdot \frac 1{(x-2)^2}\tag{1}$$
Now, back to the original fraction; let's go through how it is decomposed:
$$\dfrac{x}{(x-2)^2(x+1)} = \frac A{x+1} + \frac B{x-2} + \frac C{(x-2)^2}\tag{2}$$ Now the objective is to solve for $A, B, C$.
We now find that $$A(x-2)^2 + B(x+1)(x-2) + C(x+1) = x \tag{3}$$ $(3)$ is what we'd get if we multiplied each side of equation $(2)$ by the denominator of the right-hand side.
We can then solve for $A, B, C$ by expanding the left hand side of $(3)$, and equating coefficients from left and right, and obtaining a system of three equations in three unknowns. But in this case, another method works quite nicely.
Evaluate $(3)$ at $x = 2 \implies 3C = 2 \iff C= \frac 23$.
Evaluate $(3)$ at $x = -1 \implies 9A = -1\iff A =-\frac 19$.
Now, solve for $B$ using the found values of $A, C$, setting $x = 0$, say. Then evaluate. If you do this, you'll obtain $B = \frac 19$.
Now, replace $A, B, C$ in the right-hand side of equation $(2)$. Compare this with the right-most expression of equation $(1)$.
</s>