How does this algebraic trick regarding partial fraction works? Suppose I have to evaluate the integral $$\int \frac{x}{(x-1)(2x+1)(x+3)} \, dx  $$
I write it as $$\frac{a_1}{x-1} +\frac{a_2}{2x+1} +\frac{a_3}{x+3}$$
where $a_1$, $a_2$, $a_3$ are constants. once I have foud relationaships between them I solve for the $a_{i}$ and subsequently substitute them into the integral.
It can be observed that for finding this constants we may use following trick.
Suppose we have to find $a_1$ then for time being remove the term beneath $a_1$ from the relation $$\frac{a_1}{x-1} +\frac{a_2}{2x+1} +\frac{a_3}{x+3}$$ now put the value of $x$ that would appear if the removed term is equated to $0$ in $\frac{x}{(x-1)(2x+1)(x+3)}$. This the value of constant $a_1$.
How does this works ?
 A: As you wrote, $$\frac x {(x-1)(2x+1)(x+3)}=\frac {a_1}{x-1}+\frac {a_2}{2x+1}+\frac {a_3}{x+3}$$ As Peter commented, multiply everything by $(x-1)(2x+1)(x+3)$; this gives $$x=a_1(2x+1)(x+3)+a_2(x-1)(x+3)+a_3(x-1)(2x+1)$$ First make $x=1$ so $$1=a_1\times3\times 4=12a_1$$ Do the same with $x=-3$ and $x=-\frac 12$. You immediately get the value of each of the  $a_i$'s without needing to solve any equation.
Remember the trick : it is extremely useful.
A: We have $$\frac{x}{(x-1)(2x+1)(x+3)}=\frac{a_1}{x-1}+\frac{a_2}{2x+1}+\frac{a_3}{x+3}.$$
Then, we get $$(x-1) \times \frac{x}{(x-1)(2x+1)(x+3)}=\frac{x}{(2x+1)(x+3)}=a_1+\frac{a_2(x-1)}{2x+1}+\frac{a_3(x-1)}{x+3}. $$ If we take $x=1,$ then we find 
$$\frac{1}{3 \times 4}=\frac{1}{12}=a_1.$$ We proceed similarly, we get $$(2x+1) \times \frac{x}{(x-1)(2x+1)(x+3)}=\frac{x}{(x-1)(x+3)}=\frac{a_1(2x+1)}{x-1}+a_2+\frac{a_3(2x+1)}{x+3}.$$ If $x=-1/2$ then, $a_2=2/15.$ Finally,
$a_3=3/20.$ So, $$\frac{x}{(x-1)(2x+1)(x+3)}=\frac{1}{12(x-1)}+\frac{2}{15(2x+1)}+\frac{3}{20(x+3)}.$$ 
A: Notice, the partial fractions $$\frac{x}{(x-1)(2x+1)(x+3)}=\frac{A}{x-1}+\frac{B}{2x+1}+\frac{C}{x+3}$$ On solving for $A, B, C$, we get $A=\frac{1}{12}$, $B=\frac{2}{15}$ & $C=-\frac{3}{20}$
$$=\frac{1}{12(x-1)}+\frac{2}{15(2x+1)}-\frac{3}{20(x+3)}$$
Hence, we have $$\int \frac{x}{(x-1)(2x+1)(x+3)}=\int\frac{1}{12(x-1)}+\frac{2}{15(2x+1)}-\frac{3}{20(x+3)}dx=$$ $$=\frac{1}{12}\ln(x-1)+\frac{1}{15}\ln(2x+1)-\frac{3}{20}\ln(x+3)+c$$
A: after the hint above we get by multiplying and sorting the coefficients
$$x=x^2(2A+B+2C)+x(7A+2B-C)+3A-3B-C$$ comparing the left and the right hand side we get the system
$$2A+B+2C=0$$
$$7A+2B-C=1$$
$$3A-3B-C=0$$
