# Probability Density Function of Two Independent Exponential Random Variables

Given that the lifetime of a certain type of lightbulb is distributed according to an exponential random variable with a parameter $$\lambda$$. You turn one light on, leave it in until it fails, and then immediately replace it with an exact identical lightbulb and leave that one until it fails. Find the probability density function for the total time the bulbs were on, and use it to calculate its expected value.

I have defined $$X_i$$ to be the random variable denoting the lifetime of the ith bulb.

I think that the probability density function of time lifetime should be the probability density function of $$X_1+X_2$$ but I am unsure of why mathematically that is.

Note: The lightbulbs are the exact same and have the same parameter $$\lambda$$.

Given $$X_i$$ are independent exponential random variables $$\exp(\lambda)$$, then $$\sum_{i=1}^k X_i$$ has Erlang distribution with the density function $$f(x;k,\lambda) = \frac{\lambda^k x^{k-1} e^{-\lambda x}}{(k-1)!}$$
It is straightforward to derive the Erlang distribution for $$k=2$$. Let's start with computing the distribution function and then differentiate it to obtain the density function.
$$P(X_1 + X_2 \le x) = \int_0^x P(X_1 + X_2 \le x | X_2 = z) f_{X_2}(z) dz = \int_0^x P(X_1 \le x - z) \lambda e^{-\lambda z} = \int_0^x (1 - e^{-\lambda(x - z)}) \lambda e^{-\lambda z} dz = \int_0^x (\lambda e^{-\lambda z} - \lambda e^{-\lambda x})dz = 1 - e^{-\lambda x} - \lambda x e^{-\lambda x}$$
Differentiating the latter we get the pdf: $$\lambda^2 x e^{-\lambda x}$$