TITLE: How to do this integration?
QUESTION [5 upvotes]: 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.

REPLY [5 votes]: 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.$$

REPLY [4 votes]: 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}$$