4.1.3 Functions of Continuous Random Variables
If is a continuous random variable and is a function of , then itself is a random variable. Thus, we should be able to find the CDF and PDF of . It is usually more straightforward to start from the CDF and then to find the PDF by taking the derivative of the CDF. Note that before differentiating the CDF, we should check that the CDF is continuous. As we will see later, the function of a continuous random variable might be a non-continuous random variable. Let's look at an example.
Example
Let be a random variable, and let .
- Find the CDF of .
- Find the PDF of .
- Find .
- Solution
- First, note that we already know the CDF and PDF of . In particular,
\begin{equation} %\label{eq:CDF-uniform}
\nonumber F_X(x) = \left{
\begin{array}{l l}
0 & \quad \textrm{for } x < 0 \
x & \quad \textrm{for }0 \leq x \leq 1\
1 & \quad \textrm{for } x > 1
\end{array} \right.
\end{equation}
It is a good idea to think about the range of before finding the distribution. Since
is an increasing function of and , we conclude that .
So we immediately know that
To find for , we can write
$\textrm{since is an increasing function}$ $\textrm{since $0 \leq \ln y \leq 1.} To summarize \begin{equation} \nonumber F_Y(y) = \left{ \begin{array}{l l} 0 & \quad \textrm{for } y < 1 \ \ln y & \quad \textrm{for }1 \leq y < e\ 1 & \quad \textrm{for } y \geq e \end{array} \right. \end{equation}
The above CDF is a continuous function, so we can obtain the PDF of by taking its derivative. We have \begin{equation} \nonumber f_Y(y)=F'_Y(y) = \left{ \begin{array}{l l} \frac{1}{y} & \quad \textrm{for }1 \leq y \leq e\ 0 & \quad \textrm{otherwise} \end{array} \right. \end{equation} Note that the CDF is not technically differentiable at points $1$ and , but as we mentioned earlier we do not worry about this since this is a continuous random variable and changing the PDF at a finite number of points does not change probabilities.
To find the , we can directly apply LOTUS,
For this problem, we could also find using the PDF of ,
Note that since we have already found the PDF of it did not matter which method we used to find . However, if the problem only asked for without asking for the PDF of , then using LOTUS would be much easier.
- First, note that we already know the CDF and PDF of . In particular,
\begin{equation} %\label{eq:CDF-uniform}
\nonumber F_X(x) = \left{
\begin{array}{l l}
0 & \quad \textrm{for } x < 0 \
x & \quad \textrm{for }0 \leq x \leq 1\
1 & \quad \textrm{for } x > 1
\end{array} \right.
\end{equation}
It is a good idea to think about the range of before finding the distribution. Since
is an increasing function of and , we conclude that .
So we immediately know that
Example
Let and . Find the CDF and PDF of .
- Solution
First, we note that . As usual, we start with the CDF. For , we have
Thus, the CDF of is given by \begin{equation} \nonumber F_Y(y)= \left{ \begin{array}{l l} 0 & \quad \textrm{for } y < 0\ \sqrt{y} & \quad \textrm{for }0 \leq y \leq 1\ 1 & \textrm{for } y > 1 \end{array} \right. \end{equation} Note that the CDF is a continuous function of , so is a continuous random variable. Thus, we can find the PDF of by differentiating , \begin{equation} \nonumber f_Y(y)=F'_Y(y) = \left{ \begin{array}{l l} \frac{1}{2\sqrt{y}} & \quad \textrm{for }0 \leq y \leq 1\ 0 & \quad \textrm{otherwise} \end{array} \right. \end{equation}
The Method of Transformations
So far, we have discussed how we can find the distribution of a function of a continuous random variable starting from finding the CDF. If we are interested in finding the PDF of , and the function satisfies some properties, it might be easier to use a method called the method of transformations. Let's start with the case where is a function satisfying the following properties:
- is differentiable;
- is a strictly increasing function, that is, if , then .
Now, let be a continuous random variable and . We will show that you can directly find the PDF of using the following formula. \begin{equation} \nonumber f_Y(y) = \left{ \begin{array}{l l} \frac{f_X(x_1)}{g'(x_1)}=f_X(x_1). \frac{dx_1}{dy} & \quad \textrm{where } g(x_1)=y\ 0 & \quad \textrm{if }g(x)=y \textrm{ does not have a solution} \end{array} \right. \end{equation} Note that since is strictly increasing, its inverse function is well defined. That is, for each , there exists a unique such that . We can write .
| $=P(X < g^{-1}(y)) \hspace{30pt} \textrm{ since is strictly increasing}$ | |
To find the PDF of , we differentiate
We can repeat the same argument for the case where is strictly decreasing. In that case, will be negative, so we need to use . Thus, we can state the following theorem for a strictly monotonic function. (A function is called strictly monotonic if it is strictly increasing or strictly decreasing.)
Theorem Suppose that is a continuous random variable and is a strictly monotonic differentiable function. Let . Then the PDF of is given by \begin{equation} \nonumber f_Y(y)= \left{ \begin{array}{l l} \frac{f_X(x_1)}{|g'(x_1)|}=f_X(x_1). |\frac{dx_1}{dy}| & \quad \textrm{where } g(x_1)=y\ 0 & \quad \textrm{if }g(x)=y \textrm{ does not have a solution} \end{array} \right. \hspace{10pt} (4.5) \end{equation}
To see how to use the formula, let's look at an example.
Example
Let be a continuous random variable with PDF \begin{equation} \nonumber f_X(x) = \left{ \begin{array}{l l} 4x^3& \quad 0 < x \leq 1\ 0 & \quad \text{otherwise} \end{array} \right. \end{equation} and let . Find .
- Solution
First note that . Also, note that is a strictly decreasing and differentiable function on , so we may use Equation 4.5. We have . For any , . So, for
Thus, we conclude \begin{equation} \nonumber f_Y(y) = \left{ \begin{array}{l l} \frac{4}{y^5}& \quad y \geq 1\ 0 & \quad \text{otherwise} \end{array} \right. \end{equation}
Theorem 4.1 can be extended to a more general case. In particular, if is not monotonic, we can usually divide it into a finite number of monotonic differentiable functions. Figure 4.3 shows a function that has been divided into monotonic parts. We may state a more general form of Theorem 4.1.

Fig.4.3 - Partitioning a function to monotone parts.
Theorem Consider a continuous random variable with domain , and let . Suppose that we can partition into a finite number of intervals such that is strictly monotone and differentiable on each partition. Then the PDF of is given by
Let us look at an example to see how we can use Theorem 4.2.
Example
Let be a continuous random variable with PDF
- Solution
We note that the function is strictly decreasing on the interval , strictly increasing on the interval , and differentiable on both intervals, . Thus, we can use Equation 4.6. First, note that . Next, for any we have two solutions for , in particular,
Note that although $0 \in R_X$ it has not been included in our partition of . This is not a problem, since . Indeed, in the statement of Theorem 4.2, we could replace by , where is any set for which . In particular, this is convenient when we exclude the endpoints of the intervals. Thus, we have
