Partial fractions - integration $$\int \frac{4}{(x)(x^2+4)} $$ 
By comparing coefficients, 
$ 4A = 4 $,
$A = 1$ 
$1 + B = 0 $, 
$B= -1 $ 
$xC= 0 $, 
$C= 0 $ 
where $\int \frac{4}{x(x^2+4)}dx =\int \left(\frac{A}{x} + \frac{Bx+C}{x^2 + 4}\right)dx$. 
So we obtain $\int \frac{1}{x} - \frac{x}{x^2+4} dx$. 
And my final answer is 
$\ln|x| - x \ln |x^2 + 4| + C$. 
However my answer is wrong , the answer is - $\ln|x| - \frac{1}{2} \ln |x^2 + 4| + C$. 
Where have I gone wrong?

Writing 
$$
\frac{4}{x(x^2+4)} = \frac{A}{x} + \frac{Bx+C}{x^2+4},  
$$
you saw that $A=1$, $B=-1$, and $C=0$. 
So you have 
$$
\int \frac{4}{x(x^2+4)}dx  = \int \frac{dx}{x}  - \int \frac{x}{x^2+4} dx. 
$$
To integrate the second term on the right, do a $u$-substitution: 
let $u=x^2+4$. Then $du=2xdx$. 
So 
$$
\int \frac{dx}{x}  - \int \frac{x}{x^2+4} dx 
= \int \frac{dx}{x}  - \frac{1}{2}\int \frac{du}{u}.  
$$
After integrating term-by-term, change the $u$ back into $x^2+4$. 
