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

  • $\begingroup$ Thankyou! Through your answer I realized what mistake I was making when integrating by parts. Unfortunately I still dont understand how insertin infinity into xe^{-lambda*x) returns 0. Wouldnt that return: undefined/any number possible? $\endgroup$ – Andre Apr 8 at 12:01
  • 4
    $\begingroup$ @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. $\endgroup$ – gunes Apr 8 at 12:27
  • $\begingroup$ Thank you! I get it now. Still quite new to this. $\endgroup$ – Andre Apr 8 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.