# Why integration by long division gives different answer than using u substitution? [closed]

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.$$

• The second solution is the same as the first, up to a difference in $C$.
– user856
Nov 27 '19 at 7:12
• Possible duplicate: math.stackexchange.com/questions/2816513/… Nov 27 '19 at 13:56
• Also related: , , ,  Nov 27 '19 at 13:59
• math.stackexchange.com/questions/3453558/… Nov 27 '19 at 18:58
• They differ only by an arbitrary constant. First one is $x^2-2x+6,$ and the second one is $x^2-2x-6$ Nov 27 '19 at 19:58

Note that

$$\frac{(x+2)^2}2-4(x+2)+6\ln|x+2|+C=\frac{x^2}2-2x-6+6\ln|x+2|+C=$$

$$=\frac{x^2}2-2x+6\ln|x+2|+(C-6)=\frac{x^2}2-2x+6\ln|x+2|+C_1$$

therefore the two results are the same up to a constant which is not essential, indeed in both cases

$$\frac{d}{dx}\left(\frac{x^2}2-2x+6\ln|x+2|+C\right)=\frac{x^2+2}{x+2}$$

• Yes of course! Thanks
– user
Nov 27 '19 at 7:26
• So $$\frac{x^2-4x-12}{2}$$ is same as $$\frac{x^2-4x}{2}$$ ? Nov 27 '19 at 7:32
• @JameelKhamis No, they are not the same. However, they only differ by a constant: $$\frac{x^2 - 4x - 12}{2} = \frac{x^2 - 4x}{2} + \underbrace{(-6)}_{=C}.$$ Nov 28 '19 at 19:25

Your answers differ by a constant. Therefore, if one of them is correct, the other one is correct too.

• so, that -12 won't make any difference to the answer, correct? Nov 27 '19 at 7:34
• Correct. For instance, both $x$ and $x-12$ are such that their derivative is $1$. Nov 27 '19 at 7:36