<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] We want to integrate an integral of the form
$$\int \dfrac{dx}{(ax+b)^n}$$
Let $y=ax+b$. We then have $dy = a dx \implies dx = \dfrac{dy}a$
$$\int \dfrac{dx}{(ax+b)^n} = \int \dfrac{dy}{ay^n} = \dfrac{y^{-n+1}}{a(-n+1)} + \text{constant} = \dfrac1{a(1-n)(ax+b)^{n-1}} + \text{constant}$$
</s>