$$\int \frac{x^{2}+4x}{x+2}\,dx$$

I have written it in this form:

$$\int \frac{(x+2)^{2}-4}{x+2}\,dx$$: on this stage I try to do integration by parts, which gets me to :

$$\frac{x^{2}}{2}+2x-4\ln\left | {x+2} \right |$$

but it's wrong for some reason. The right answer is : $$\frac{x^{2}+4x+4}{2}-4\ln\left | x+2 \right |$$

Where am I wrong?

  • 3
    $\begingroup$ Looks the same to me... $\endgroup$ – Lord Shark the Unknown Jun 22 '18 at 19:04
  • 12
    $\begingroup$ Remember... $+C$ $\endgroup$ – Sean Roberson Jun 22 '18 at 19:05
  • $\begingroup$ Also it's not quite wrong. Just combine the left two terms into a fraction and you'll see it's almost the same (sans constant of integration). $\endgroup$ – Cameron Williams Jun 22 '18 at 19:05
  • 4
    $\begingroup$ In this case, it was easy to see that your confusion was due to the constant of integration, but in general, saying something like "I try to do integration by parts", and then immediately skipping to your answer, without showing any of your intermediate steps (not even telling us what you used as u and v) is going to seriously hamper answerers' ability to spot where you went wrong. $\endgroup$ – Acccumulation Jun 22 '18 at 19:29
  • $\begingroup$ You forgot the constant... $\endgroup$ – Jason Kim Jun 27 '18 at 18:01

You forgot the constant of integration. Your answer differs from the one given by a constant.


Note that we have $$\frac{x^2+4x+4}2-4\ln|x+2|+C=\frac{x^2}2+2x\color{red}{+2}-4\ln|x+2|+C$$ and this is the same as your expression if we let $C_1=C+2$!

A quicker way: $$\int \frac{(x+2)^{2}-4}{x+2}\,dx=\int\left[x+2-\frac4{x+2}\right]\,dx=\frac{x^2}2+2x-4\ln|x+2|\color{blue}{+C}.$$


Also, it should be $$\frac{x^{2}+4x+4}{2}-4\ln\left | x+2 \right |+C_1=\frac{x^{2}+4x+4}{2}-4\ln(x+2)+C_1$$ for $x>-2$ and $$\frac{x^{2}+4x+4}{2}-4\ln\left | x+2 \right |+C_2=\frac{x^{2}+4x+4}{2}-4\ln(-x-2)+C_2$$ for $x<-2$.


Instead of Integration By Parts you can use $u$ substitution which is easy.

$u=x+2$ which gives $$\int\frac{u^2-4}{u}du=\frac{u^2}{2}-4\ln|u|+C$$ $$=\frac{(x+2)^2}{2}-4\ln|x+2|+C$$ $$=\frac{x^{2}+4x+4}{2}-4\ln\left | x+2 \right |+C$$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.