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