Is $e^{\int \frac {1}{x}dx}$ equal to $x$ or $|x|$?

170 Views Asked by At

I encountered this expression quite a lot of times as a part of the integrating factor while solving linear differential equations.

$$e^{\int \frac {1}{x}dx}$$

For sometime, I wrote it as $x$, and was satisfied as even the answer given in my textbook had $x$ instead of $|x|$. But after realising the possibility to be $|x|$, I am confused.

What should be the answer, and why?

Edit: (My reasoning)

$\int \frac {1}{X} dx = log |x|$ and $e^{logt} = t$ if I'm not wrong. So in this case, $t = |x|$ so the answer should be $|x|$.

What is wrong with this reasoning? And could you please provide a mathematical proof if the answer should be $x$?

Edit 2:

Wolfram Alpha evaluates e^(∫(1/x)dx) to $x$

2

There are 2 best solutions below

5
On BEST ANSWER

Simple answer

The correct expression is $|x|$. The antiderivative of $\frac1x$ is $\log |x|$, which can be verified by computing the derivative of $\log |x|$ in the region $x>0$ and $x<0$ separately.

Correct answer

Neither is correct; the correct answer is $C|x|$, for some $C>0$, because you need to remember the constant! $$ e^{\int \frac1x\,dx}=e^{\log|x|+K}=e^K|x|:= C|x|. $$

Super nitpicky correct answer

Actually, integrating $\frac1x$ requires two constants; one in the $x>0$ region, one in the $x<0$ region. You can verify that for any $K_1,K_2$, the following piecewise function is an antiderivative of $1/x$: $$ f(x)=\begin{cases} \log|x|+K_1 & x>0\\ \log|x|+K_2 & x<0 \end{cases} $$ This is the full answer, because every antiderivative does have this form. Therefore, $$ e^{\int\frac1x\,dx}=\begin{cases} C_1|x| & x>0\\ C_2|x| & x<0 \end{cases} $$ where $C_1,C_2>0$.

0
On

The general antiderivative is as described in the answer by Mike Earnest.

But in the context of ODEs, where you're going to multiply both sides of the equation by the integrating factor, you can just multiply by $x$ instead of $|x|$, since if $x<0$ the only thing that would be different is a factor of $-1$ one both sides, which doesn't make any difference as far as the ODE is concernced. (And for the same reason, you don't gain any generality by multiplying by the most general antiderivative $C_{1,2}|x|$.)