More generally, consider the function $f(x;\theta)=(1/\theta)e^{-x/\theta}$, $x \geq 0$, where $\theta > 0$ is fixed, i.e. the density function of the exponential distribution with mean $\theta$. It is strictly decreasing and convex. $ \int {f(x;\theta )dx} = - e^{ - x/\theta } + C$, and $F(x): = \int_0^x {f(u;\theta )du} = 1 - e^{ - x/\theta } $, for any $x \geq 0$ (distribution function of exponential distribution); in particular $\int_a^b {f(x;\theta )dx} = F(b) - F(a) = e^{ - a/\theta } - e^{ - b/\theta } $. The corresponding expectation is $\int_0^\infty {xf(x;\theta )dx} = \theta $, and more generally, the corresponding $n$th moment is given, for all $n \in \mathbb{N}$, by \mu'_n := \int_0^\infty {x^n f(x;\theta )dx} = \theta ^n \int_0^\infty {x^n e^{ - x} dx} = \theta ^n \Gamma (n + 1) = \theta ^n n!, where $\Gamma$ denotes the gamma function. In particular, the corresponding variance is given, according to the formula ${\rm Var}(X)={\rm E}(X^2)-{\rm E}^2(X)$, by \mu'_2 - (\mu'_1)^2 = 2 \theta^2 - \theta^2 = \theta^2.