$\displaystyle \dfrac{2x+1}{(x+2)^2}=\dfrac{A}{x+2}+\dfrac{B}{(x+ 2)^2}=\dfrac{A(x+2)+B}{(x+2)^2}$
$\displaystyle A(x+2)+B=2x+1\Rightarrow A=2,B=-3$
Fernando Revilla
Edited: Sorry, I didn't see TheCoffeeMachine's post.
An alternative:
$\displaystyle \displaystyle \int{\frac{2x + 1}{(x + 2)^2}\,dx} = \int{\frac{2x + 4 - 3}{(x + 2)^2}\,dx}$
$\displaystyle \displaystyle = \int{\frac{2x + 4}{x^2 + 4x + 4}\,dx} - 3\int{(x + 2)^{-2}\,dx}$.
Substitute $\displaystyle \displaystyle u = x^2 + 4x + 4$ so that $\displaystyle \displaystyle du = (2x + 4)\,dx$ and substitute $\displaystyle \displaystyle v = x + 2$ so that $\displaystyle \displaystyle dv = dx$ and the integrals become
$\displaystyle \displaystyle \int{\frac{1}{u}\,du} - 3\int{v^{-2}\,dv}$.
I'm sure you can go from here.
Divide numerator and denominator by $\displaystyle x+2$ .
Fernando Revilla