# Is it OK to cancel absolute value $|x|$ in such a integral $\int_{-\infty}^0\frac{1}{{|x|}^p}dx$ using $|x| = (-x)$?

I'd like to cancel the absolute value of $x$ in $$\int_{-\infty}^0\frac{1}{{|x|}^p}dx$$ like this: $$\int_{-\infty}^0\frac{1}{{|x|}^p}dx = \int_{-\infty}^0\frac{1}{(-x)^p}dx$$ and when $p = 1$, something confused me: $$\int_{-\infty}^0\frac{1}{{|x|}}dx = \int_{-\infty}^0\frac{1}{-x}dx = \int_{-\infty}^0\frac{1}{x}dx = \ln x\Big|^0_{-\infty}$$

however, $\ln x$ is not defined when $x \leq 0$. What's wrong with my calculation?

I made mistakes. I renew it as:

$$\int_{-\infty}^0\frac{1}{{|x|}}dx = \int_{-\infty}^0\frac{1}{-x}dx = -\int_{- \infty}^0\frac{1}{x}dx = \ln |x|\Big|^0_{-\infty}$$

was it OK to write it like the snow?

• your mistake is $\int_{-\infty}^0\frac{1}{-x}dx = \int_{-\infty}^0\frac{1}{x}dx$. To cross over Take $t=-x$, and then you will get $\int_0^\infty\frac{1}{t}dt$
– A s
Jun 9, 2016 at 9:30

First of all, you made a mistake in the line

$$\int_{-\infty}^0\frac{1}{-x}dx=\int_{-\infty}^0\frac1x dx.$$

You can't do that!

Second, your mistake is in the integral itself, since:

$$\int \frac1xdx = \ln|x| + C\neq \ln x + C$$

Your calculation missed out a minus sign: $$\int_{-\infty}^0\frac{1}{{|x|}}dx = \int_{-\infty}^0\frac{1}{-x}dx = \color{red}{-}\int_{-\infty}^0\frac{1}{x}dx = \color{red}{-}lnx|^0_{-\infty}$$

This logarithm is infinite at both ends of the range, so the formula fails.

This failure is a successful result because the area between the curve $y=\frac{1}{x}$ and the x-axis is in fact infinite. If you had got a result, it would have been wrong.

If you didn't have $0$ and $-\infty$ as the endpoints, then the logarithm of negative numbers wouldn't be a problem. Either you can remember that the logarithm of $-x$ is $i\pi$ plus the logarithm of $x$ (any odd multiple of $i\pi$ will work as long as you use the same one throughout), or you can do a change of variables of the form $t=-x$.

• The logarithm you write is not defined at either end of the range and in no neighborhood thereof. Did you mean to write $-\ln|x|\Big|_{-\infty}^0$? Jun 9, 2016 at 11:08
• No; as the answer explains, any branch of the complex-valued logarithm would do (since we are going to subtract, anyway). Jun 9, 2016 at 12:00

Yes, if $x<0$, then $|x|=-x$. So you can write $$\int_{-\infty}^{0}\frac{1}{|x|^p}\,dx= \int_{-\infty}^{0}\frac{1}{(-x)^p}\,dx= \int_{\infty}^0\frac{1}{t^p}(-1)\,dt= \int_0^{\infty}\frac{1}{t^p}\,dt$$ using the substitution $x=-t$. In the case $p=1$ this has a meaning if and only if both $$\int_0^1\frac{1}{t}\,dt \qquad\text{and}\qquad \int_1^{\infty}\frac{1}{t}\,dt$$ exist and are finite, but neither is: $$\int_0^1\frac{1}{t}\,dt= \lim_{\delta\to0^+}\int_\delta^1\frac{1}{t}\,dt =\lim_{\delta\to0^+}\Bigl[\ln t\Bigr]_{\delta}^1=\infty$$ and, similarly, $$\int_1^\infty\frac{1}{t}\,dt= \lim_{k\to\infty}\int_1^k\frac{1}{t}\,dt =\lim_{k\to\infty}\Bigl[\ln t\Bigr]_1^k=\infty$$

Would you say that $\int_{0}^1(-x)\,dx=\int_{0}^1 x\,dx$? I guess not; so you can't say $$\int\frac{1}{-x}\,dx=\int\frac{1}{x}\,dx$$ either, can you?

Besides, an antiderivative for $1/x$ on the interval $(-\infty,0)$ is $\ln(-x)$, not $\ln x$ which is defined at no point of $(-\infty,0)$.