# Integrating $e^{f(x)}$

can someone tell me a way of integrating functions like $e^{f(x)}$

I have a specific case: $\int e^{-3x}\,\mathrm{d}x$

PS: I'm not looking for the answer of this, but the way of doing it.

Thanks for your help

• In this case, try a substitution. In general, it may be impossible to write down an antiderivative (famously, $e^{x^2}$ has no antiderivative that can be expressed in an elementary way). – Arturo Magidin Jan 28 '11 at 20:25
• P.S. Don't forget the "$dx$". – Arturo Magidin Jan 28 '11 at 20:26

## 3 Answers

For the case where $f(x)$ is linear, a nice $u$-substitution works. I assume you know how to integrate $\int e^xdx$? So in order to integrate a function of the form $e^{f(x)}$, let $u=f(x)$, and thus $du=f'(x)dx$, which allows you to 'solve' for $dx$ in terms of $du$. Then your original integral goes from:
$$\int e^{f(x)}dx$$ to $$\int \frac{e^u}{f'(x)}du.$$ Of course, this is not always so easy to integrate, as Moron points out. When $f(x)$ is linear, you have a nice situation, because $f'(x)$ is just a constant. Other situations may not be so easily handled, as far as I'm aware.

• Thanks, that's what I was looking for... I wanted to know if the u-substitution could work. – Pacane Jan 28 '11 at 20:52
• @Pacane: Why not try it yourself? It's not like you'll be shot if it doesn't work... – Arturo Magidin Jan 28 '11 at 20:54
• Well I tried it but I used $e^{f(x)}$ as my u... stupid mistake :P – Pacane Jan 28 '11 at 20:55
• As a rule of thumb, $e^{f(x)}$ can't be integrated in closed-form. – Yves Daoust Nov 6 '17 at 18:44

If you mean a way to obtain an anti-derivative in terms of elementary functions, there is no such general algorithm: it is known that for $f(x) = -x^2$, $\int e^{f(x)}$ cannot be written in terms of elementary functions.

There are some general algorithms for computing anti-derivatives though, for instance: Risch's algorithm.

Your specific case is much easier than what you have generalized your problem too.

Hint: What is the derivative of $e^{-3x}$ ?

• Thanks for your help though :) Appreciated! – Pacane Jan 28 '11 at 20:54

Interesting, I fired my old symbolic algebra program and typed the following

$$\int{\exp\left(C_{0}+C_{1}x-C_{2}x^{2}\right)}\,\mathrm{d}x=$$

and it gave the answer

$$=\sqrt{\frac{\pi}{4C_{2}}}\exp\left(C_{0}+\frac{C_{1}^{2}}{4C_{2}}\right)\mathrm{erf}\left(\frac{C_{1}}{2\sqrt{C_{2}}}-\sqrt{C_{2}}\, x\right)$$

or more simply

$$\int{\exp\left(-x^2\right)}\,\mathrm{d}x = \frac{\sqrt{\pi}}{2}\,\mathrm{erf}(x)$$

with $\mathrm{erf}(x)$ the error-function which is not an elementary function.

So although a general solution may not exist, I am sure there are special cases where as solution is feasible.