<s>[INST] How to do this integration? I'm trying to integrate $$\frac{8x^2+3x+1}{x(2x+1)^2}$$
I did a partial fraction expansion: $$\frac{8x^2+3x+1}{x(2x+1)^2}= \frac{1}{x}+\frac{2}{2x+1}-\frac{3}{(2x+1)^2}$$
and now I'm left with $$\int\left(\frac{1}{x}+\frac{2}{2x+1}-\frac{3}{(2x+1)^2}\right)dx$$
I would get $\ln(x) + \ln(2x+1)$ from integrating  $\frac{1}{x}+\frac{2}{2x+1}$ but I do not quite know how to integrate 
$$ \frac{3}{(2x+1)^2} $$
It would be great if someone can teach me what steps I need to take to integrate $\frac{3}{(2x+1)^2}$, thanks.
 [/INST] Substitute $u=2x+1 \implies du=2dx $. Then the integral is $$\int\frac{3}{2}\frac{1}{u^2}du=\frac{-3}{2u}+C'=\frac{-3}{4x+2}+C.$$
</s>