$\int\frac{x^2}{x^2-4}dx$ and $\int\frac{x^2-4}{x^2-4}dx+\int\frac{4}{x^2-4}dx$
The first one is $\ln |x-2|-\ln|x+2|$ and the second one is $x+\frac{1}{4}\ln |x-2|-\frac{1}{4}\ln|x+2|$. Shouldn't they have the same answer? For full context, the problem I am trying to solve is $\int\ln\sqrt{x^2-4}\ dx$. Thank you very much in advance.
I am sure that you computed the value of $\int_{}^{}\frac{x^2}{x^2-4}dx$ wrong. I shall show it via partial fraction decomposition $$\int_{}^{}\frac{x^2}{x^2-4}dx=\frac{1}{4}\int_{}^{}\frac{x^2}{x-2}dx+\frac{1}{4}\int_{}^{}\frac{x^2}{x+2}dx$$ Substitute $u=x-2\implies du=dx$ and $v=x+2\implies dv=dx$ First integral will be $$\int_{}^{}\frac{(u+2)^2}{u}du$$ Expansion of $(u+2)^{2}$ using binomial theorem we have $$\int_{}^{}udu+4\int_{}^{}\frac{du}{u}+4\int_{}^{}\frac{du}{u}$$. I hope you can proceed from here and also calculate second integral too