# How do I solve $\int e^{\frac{1}{x}}dx$?

I'm trying to solve this as part of some problem, but I'm not able to.

Can anyone integrate the above problem?

Please let me know. Thank you.

• Do you have any suggestion? What have you done yourself? Dec 1, 2017 at 5:58
• I tried by various substitutions but I just arrive at some dead end.
– MB17
Dec 1, 2017 at 6:02

$$\int e^{1/x} \, dx=e^{1/x} x-\text{Ei}\left(\frac{1}{x}\right) + c$$

where $\operatorname{Ei}(x)$ is the exponential integral function defined as

$$\operatorname{Ei}(x) = - \int_{-x}^\infty \frac{e^{-t} dt}t$$

$\operatorname{Ei}(x)$ is a non-elementary function, and we can only evaluate it using numerical methods.

• Sorry. I am not following it. You mean the solution doesnt exist?
– MB17
Dec 1, 2017 at 6:03
• @MB17 No, just that the integral can't be expressed in terms of elementary functions
– user223391
Dec 1, 2017 at 6:04

Make a substitution of $x = \tan \theta$, then you obtain

$$I = \int e^{\cot \theta} \sec^2\theta \ \ d\theta$$

Integrate by parts with $u$ being the exponential:

$$uv - \int{v \ du} = \tan \theta \ e^{\cot \theta} + \int{\dfrac{e^{\cot \theta}}{\sin \theta \cos \theta} \ d \theta}$$

Make a substitution of $u = \cot \theta \implies du = -\csc^2 \theta$, noting that $\tan \theta = 1/u$ (and substituting $x$ back in):

$$I = xe^{1/x} - \int{\dfrac{e^u}{u} \ du}$$

We arrive at the final answer by substituting everything back in:

$$\boxed{\displaystyle I = xe^{1/x} - \operatorname{Ei} \left( \dfrac{1}{x} \right) + C}$$

I explain more of the small algebraic details here, if any step is unclear.

A note on the solution: There's actually a much simpler solution I found after realizing the trig sub is redundant. Here it is:

Start by integrating by parts, with $dv = 1$: $$\displaystyle I = xe^{1/x} - \int{\dfrac{-xe^{1/x}}{x^2} \ dx} = xe^{1/x} + \int{ \dfrac{e^{1/x}}{x} \ dx}$$ We can substitute $u = 1/x \implies du = -1/x^2 \ dx$, noting that $x = 1/u$: $$\displaystyle I = xe^{1/x} - \int{\dfrac{ue^{u}}{u^2} \ du} = xe^{1/x} - \int{\dfrac{e^{u}}{u} \ du}$$ $$\boxed{\displaystyle I = xe^{1/x} - \operatorname{Ei} \left( \dfrac{1}{x} \right) + C}$$

One simple way to do it (if an approximate solution will do) is the following:

You know the Taylor series of $e^x$ is given by $e^x = 1 + x + \frac{x^2}{2!}+...$.

Therefore the Taylor series of $e^{1/x}$ is given by $e^{1/x} = 1 + \frac{1}{x} + \frac{1}{2!x^2} +...$

Now just integrate term-by term.

• Okay. I can solve it then. Thanks:)
– MB17
Dec 1, 2017 at 12:51

There is no definite formula for this you can use series expansion of $e^x$ to compute a numerical value.

$$e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+....$$ $$\int e^{1/x}=\int1+\frac{1}{x}+\frac{1}{x^22!}+\frac{1}{x^33!}+\frac{1}{x^44!}+.... \\ \int e^x= C + x + \ln x-\frac{1}{2!}\frac{1}{x}-\frac{1}{3!}\frac{1}{2x^2}-\frac{1}{3!}\frac{1}{3x^3}-...$$

• So, There is no exact solution. Only approximated solution exists?
– MB17
Dec 1, 2017 at 6:07
• @MB17 No there is an exact solution, it just can't be expressed in terms of elementary functions
– user223391
Dec 1, 2017 at 6:07
• What is the exact solution then? In what way can it be expressed?
– MB17
Dec 1, 2017 at 6:10
• The more terms in the series you sum the more accurate the answer becomes. Dec 1, 2017 at 6:18
• Okay. I got it. Thank you:)
– MB17
Dec 1, 2017 at 12:49