# Problem when integrating $e^x / x$.

I made up some integrals to do for fun, and I had a real problem with this one. I've since found out that there's no solution in terms of elementary functions, but when I attempt to integrate it, I end up with infinite values. Could somebody point out where I go wrong?

So, I'm trying to determine: $$\int{\frac{e^x}{x}} \, dx$$

Integrate by parts, where $u = 1/x$, and $v \, ' = e^x$. Then $u \, ' = - 1/x^2$, and $v=e^x$. So,

$$\int{\frac{e^x}{x}} \, dx = \frac{e^x}{x} + \int{\frac{e^x}{x^2}} \, dx$$

Integrate by parts again, $u = 1/x^2$, $v \, ' = e^x$, so that $u \, ' = -2/x^3$ and $v=e^x$. So,

$$\int{\frac{e^x}{x}} \, dx = \frac{e^x}{x} + \frac{e^x}{x^2} + 2\int{\frac{e^x}{x^3}} \, dx$$

Repeat this process ad infinitum to get,

$$\int{\frac{e^x}{x}} \, dx = \frac{e^x}{x} + \frac{e^x}{x^2} + 2 \left( \frac{e^x}{x^3} + 3 \left( \frac{e^x}{x^4} + 4 \left( \frac{e^x}{x^5} + \, \cdots \right) \right) \right)$$

Expanding this gives,

$$\int{\frac{e^x}{x}} \, dx = \frac{e^x}{x} + \frac{e^x}{x^2} + \frac{2e^x}{x^3} + \frac{6 e^x}{x^4} + \frac{24 e^x}{x^5} + \cdots$$

And factoring that gives,

$$\int{\frac{e^x}{x}} \, dx = \frac{e^x}{x} \left( 1 + \frac{1}{x} + \frac{2}{x^2} + \frac{6}{x^3} + \frac{24}{x^4} + \cdots \right)$$

Now, considering the series itself, the ratio between the $n^{th}$ term and the $(n-1)^{th}$ term = $\Large \frac{n}{x}$. Eventually, $n$ will be larger than $x$, so the ratio between successive terms will be positive, so (assuming $x$ is positive), the series diverges, meaning (and I'm sure everybody will cringe upon seeing notation used like this), that:

$$\int{\frac{e^x}{x}} \, dx = \frac{e^x}{x} \left( \infty \right) = \infty$$

-
It looks as if you have discovered an asymptotic expansion. There are divergent series such that if one is sensible and cuts off early, one gets a good approximation, but if you go too far, there is trouble. Such things are even useful! –  André Nicolas Dec 5 '12 at 20:33

This part looks right:

$$\int{\frac{e^x}{x}} \, dx = \frac{e^x}{x} + \frac{e^x}{x^2} + \frac{2e^x}{x^3} + \frac{6 e^x}{x^4} + \frac{24 e^x}{x^5} + \cdots+ \frac{n!e^x}{x^{n+1}}+(n+1)!\int \frac{e^x}{x^{n+1}}$$

When you say "repeating to infinity" you want to take the limit of that...in order for your equality to hold, you need

$$\lim_n (n+1)!\int \frac{e^x}{x^{n+1}}=0 \,.$$

because that is your error in you partial sum "approximation". But not only the above limit is not 0, it actually makes no sense (an integral is a family of functions, what happens with the constant???).

That's why formally, whenever you use a process like this, you need to prove that the difference between your n-th term and the limit goes to 0...

Your idea is similar to the following

\begin{eqnarray} 1&=&1+1-1\\ &=&1+1+1-2 \\ &=&1+1+1+1-3\\ &=&.... \end{eqnarray}

Taking limit to infinity you get

$$1=1+1+1+...+1+...= \infty$$

On this example you can see immediately that the "errror" in our appoximations don't go to 0, so our approximations are not approximations.

-
Thanks, the example helped a lot. –  SiliconCelery Dec 5 '12 at 20:56

There is no elementary antiderivative for you this function.

You can take a look at here: http://en.wikipedia.org/wiki/Exponential_integral

What you have calculated here:

$$\int{\frac{e^x}{x}} \, dx = \frac{e^x}{x} \left( 1 + \frac{1}{x} + \frac{2}{x^2} + \frac{6}{x^3} + \frac{24}{x^4} + \cdots \right)$$ is even something like a taylorexpansion of the integral at $x=\infty$

-
"Like" a Taylor expansion. But divergent for every $x$ ... –  GEdgar Dec 5 '12 at 20:37