Conflicting results for $\int\frac{|x+1|}{x}\,\mathrm dx$

330 Views Asked by At

I've encountered an obstacle while trying to solve the following integral: $$\int{\frac{\sqrt{x^2+2x+1}}{x}dx}$$ First thing we shall do is see that under the square root is actually $(x+1)^2$. When I cancelled the square root I got the following integral: $$\int{\frac{|x+1|}{x}\,\mathrm dx}$$ After that I've separated the problem into two cases:
$1.$ Case: $$\int{\frac{\sqrt{x^2+2x+1}}{x}dx}=-x-\ln|x|+C,\space x<-1$$ $2.$ Case: $$\int{\frac{\sqrt{x^2+2x+1}}{x}dx}=x+\ln|x|+C,\space x>-1, x\neq{0}$$

But this apparently isn't the correct solution and the only solution is: $$\int{\frac{\sqrt{x^2+2x+1}}{x}dx}=x+\ln|x|+C,\space x\neq{0}$$ Is this really the case, and if yes, then why?

2

There are 2 best solutions below

5
On BEST ANSWER

\begin{align} \int{\frac{\sqrt{x^2+2x+1}}{x}\,\mathrm dx}={}&\int\frac{|x+1|}{x}\,\mathrm dx\\ ={}&\int\operatorname{sgn}(x+1)\left(1+\frac1x\right)\,\mathrm dx\\ ={}&\begin{cases} -x-\ln(-x)-2+C_1, &x<-1;\\ x+\ln(-x)+C_1, &-1\le x<0;\\ x+\ln(x)+C_2, &x>0 \end{cases} \end{align}

  1. This integrand is disconnected at just $0,$ so its indefinite integral requires exactly two independent parameters to capture its complete set of antiderivatives.
  2. The -2 adjustment in the first case (alternatively: a +2 adjustment in the second case) is necessary! Without it, the left piece of each antiderivative (i.e., for each $(C_1,C_2)$ couple) is discontinuous, and therefore not differentiable, at $-1$ (a non-differentiable antiderivative is of course a contradiction). It is easy to neglect this adjustment and write \begin{align} \int_{-2}^{-0.5}\frac{|x+1|}{x}\,\mathrm dx ={}&\int_{-2}^{-0.5}\operatorname{sgn}(x+1)\left(1+\frac1x\right)\,\mathrm dx\\ \color{red}={}&\Big[\operatorname{sgn}(x+1)\left(x+\ln(-x)\right)\Big]_{-2}^{-0.5}\quad\quad\Large\color{red}✗\\ ={}&-2.5,\end{align} which is incorrect, because in fact $$\int_{-2}^{-0.5}\frac{|x+1|}{x}\,\mathrm dx=-0.5.$$

A visual proof:

enter image description here

When computing the integral on $[a,b]$ of a continuous piecewise function, using the FTC piece-wise is equivalent to determining its indefinite integral then using the FTC once (at $a$ and $b$).

5
On

The piece-wise integrations may be combined as follows \begin{align} &\int{\frac{\sqrt{x^2+2x+1}}{x}\,dx}\\ =&\ \frac{|x+1|}{x+1} \int{\frac{x+1}{x}\,dx}= \frac{|x+1|}{x+1}(x+\ln |x|)+C\\ \end{align} where the domain-dependence of the constant is understood.