Integrating partial fractions I have
$\int{\frac{2x+1}{x^2+4x+4}}dx$
Factorising the denominator I have
$\int{\frac{2x+1}{(x+2)(x+2)}}dx$
From there I split the top term into two parts to make it easier to integrate
$\int{\frac{2x+1}{(x+2)(x+2)}}dx$ = $\int{\frac{A}{(x+2)}+\frac{B}{(x+2)}}dx$
=$\int{\frac{A(x+2)}{(x+2)^2}+\frac{B(x+2)}{(x+2)^2}}dx$
Therefore
$2x+1 = A(x+2) +B(x+2)$
This is where I would normally use a substitution method to eliminate either the A term or B term by letting x = something like -2, which would get rid of the A and usually leave me with the B term to solve. However since they are the same I'm not sure what to do. 
I've been told to try evaluate the co-efficients, but am not sure how. 
 A: Hint
$$\int{\frac{2x+1\color{red}{+3-3}}{x^2+4x+4}}dx=2\ln|x+2|+\frac{3}{x+2}+C$$
A: You want to try a split like
$$\frac{2 x+1}{(x+2)^2} = \frac{A}{x+2} + \frac{B x}{(x+2)^2}$$
Then $A+B=2$ and $2 A=1$.  The decomposition is then
$$\frac{2 x+1}{(x+2)^2} = \frac12 \frac1{x+2} + \frac{3}{2} \frac{x}{(x+2)^2}$$
A: All you need to do is to solve this with respect to polynomials: 
$2x+1=Ax+2A+Bx+2B$
$2x+1=x(A+B)+(2A+2B)$
$A+B=2 \rightarrow  B=2-A$
$2A+2B=1$
$2A+4-2A=1\rightarrow 4=1$
This is contradiction! You have made an mistake in step where you split the term into two fractions, you should have done it like this: 
$\frac{2x+1}{(x+2)^2}=\frac{A}{x+2}+\frac{B}{(x+2)^2}$ 
and then proceed like usual.
$A(x+2)+B=2x+1$
$A=2$
$2A+B=1$
$B=-3$
$\int \frac{2}{x+2}+\frac{-3}{(x+2)^2}dx=2ln(x+2)+\frac{3}{x+2}+C$
A: In this case we a linear repeated factor so we split it like
$$\frac{A}{(x+2)}+\frac{B}{(x+2)^2}=\frac{A(x+2)+B}{(x+2)^2}$$
and hence 
$$2x+1=A(x+2)+B=Ax+2A+B$$
then by equating coefficients 
$$A=2,\\2A+B=1\implies B=-3$$
