# Expected value of (continous) exponential distribution proof/derivation

I started with the following exponential distribution: $$f_{exp}(x;\lambda) = \lambda\, e^{-x\lambda} \quad \forall\, x \in \mathbb{R}^+$$ I know from internal courseslides and wikipedia that the expected value $$\mathbb E(X)$$ of the random variable is supposed to be $$\frac{1}{\lambda}$$, but I would like to understand how this result was derived.

It is my understanding that in the continuous case the following holds for any distribution: $$\mathbb E(X) \equiv \int x\,f(x) dx$$ for the range in which $$x$$ is defined.

So I used this formula to find $$\mathbb E(X)$$: $$\mathbb E(X) = \int_0^\infty x\,\lambda\,e^{-x\lambda} dx$$ Through partial integration I arrived at the following: $$\mathbb E(X) = x[-e^{-\lambda x}]_0^\infty - [\frac{e^{-\lambda x}}{\lambda}]_0^\infty$$ Which I can "simplify" to this: $$\mathbb E(X) = -x+e^{- \lambda \infty}x-\frac{1}{\lambda}+\frac{e^{- \lambda \infty}}{\lambda}$$

I am completely stumped on how to go from this to $$\frac{1}{\lambda}$$. Either there are further simplification steps which I don't understand or there is an error in my thinking so far. Could you help me out?

No $$x$$ can come out of the integral: \begin{align}\mathbb E[X]&=\int_0^\infty \underbrace{x}_u \underbrace{\lambda e^{-\lambda x}dx}_{dv}\rightarrow du=dx, v=-e^{-\lambda x}\\&=\left[xe^{-\lambda x}\right]_0^\infty-\int_0^\infty (-e^{-\lambda x})dx\\&=0 -\left[\frac{e^{-\lambda x}}{\lambda}\right]_0^\infty\\&=\frac{1}{\lambda}\end{align}
The first term is $$0$$ because: $$\left[xe^{-\lambda x}\right]_0^\infty=\lim_{x\rightarrow \infty} {x\over e^{\lambda x}}\overbrace{=}^{\text{L'Hospital}}\lim_{x\rightarrow \infty} \frac{1}{\lambda e^{\lambda x}}=0$$
• @Andre exponential decays much faster than the increase in $x$, so it'll converge to $0$. I've appended a mathematical explanation to the end of my answer. – gunes Apr 8 at 12:27