So, after solving this question, I got two different answers? and I don't think it's supposed to be this way?
Evaluate the integral $$\int \frac{x^2+2}{x+2} dx$$
Using polynomial long division, I get $$\frac{x^2}2-2x+6\ln|x+2|+C,$$ but using substitution, I get $$\frac{(x+2)^2}2-4(x+2)+6\ln|x+2|+C.$$