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

999 Views Asked by At

$$\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?

4

There are 4 best solutions below

0
On

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

0
On

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

0
On

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

0
On

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