In this section we develop formulas for the probability law of a random variable \(Y\) , which arises as a function of another random variable \(X\) , so that for some Borel function \(g(\cdot)\) \[Y=g(X). \tag{8.1}\] To find the probability law of \(Y\) , it is best in general first to find its distribution function \(F_{Y}(\cdot)\) , from which one may obtain the probability density function \(f_{Y}(\cdot)\) or the probability mass function \(p_{Y}(\cdot)\) in cases in which these functions exist. From (2.2) we obtain the following formula for the value \(F_{Y}(y)\) at the real number \(y\) of the distribution function \(F_{Y}(\cdot)\) : \[F_{Y}(y)=P_{X}[\{x: \quad g(x) \leq y\}] \quad \text { if } Y=g(X). \tag{8.2}\] Of great importance is the special case of a linear function \(g(x)=\) \(a x+b\) , in which \(a\) and \(b\) are given real numbers so that \(a>0\) and \(-\infty. The distribution function of the random variable \(Y=aX+b\) is given by \[F_{aX+b}(y)=P[a X+b \leq y]=P\left[X \leq \frac{y-b}{a}\right]=F_{X}\left(\frac{y-b}{a}\right). \tag{8.3}\] If \(X\) is continuous, so is \(Y=aX+b\) , with a probability density function for any real number \(y\) given by
\[f_{a X+b}(y)=\frac{1}{a} f_{X}\left(\frac{y-b}{a}\right). \tag{8.4}\]
If \(X\) is discrete, so is \(Y=a X+b\) , with a probability mass function for any real number \(y\) given by
\[p_{a X+b}(y)=p_{X}\left(\frac{y-b}{a}\right). \tag{8.5}\]
Next, let us consider \(g(x)=x^{2}\) . Then \(Y=X^{2}\) . For \(y<0,\left\{x ; \quad x^{2} \leq y\right\}\) is the empty set of real numbers. Consequently,
\[F_{X^{2}}(y)=0 \quad \text { for } y<0. \tag{8.6}\]
For \(y \geq 0\)
\begin{align} F_{X^{2}}(y) & =P\left[X^{2} \leq y\right]=P[-\sqrt{y} \leq X \leq \sqrt{y}] \tag{8.7}\\ & =F_{X}(\sqrt{y})-F_{X}(-\sqrt{y})+p_{X}(-\sqrt{y}) \end{align}
One sees from (8.7) that if \(X\) possesses a probability density function \(f_{X}(\cdot)\) then the distribution function \(F_{X^{2}}(\cdot)\) of \(X^{2}\) may be expressed as an integral; this is the necessary and sufficient condition that \(X^{2}\) possess a probability density function \(f_{X^{2}}(\cdot)\) . To evaluate the value of \(f_{X^{2}}(y)\) at a real number \(y\) , we differentiate (8.7) and (8.6) with respect to \(y\) . We obtain \begin{align} f_{x^{2}}(y) &= \begin{cases} \left[f_{X}(\sqrt{y}) + f_{X}(-\sqrt{y})\right] \frac{1}{2 \sqrt{y}}, & \text{for } y > 0 \\ 0, & \text{for } y < 0 \end{cases} \tag{8.8} \end{align} It may help the reader to recall the so-called chain rule for differentiation of a function of a function, required to obtain (8.8), if we point out that
\begin{align} \frac{d}{d y} F_{X}(\sqrt{y}) & =\lim _{h \rightarrow 0} \frac{F_{X}(\sqrt{y+h})-F_{X}(\sqrt{y})}{h} \tag{8.9}\\ & =\lim _{h \rightarrow 0} \frac{F_{X}(\sqrt{y+h})-F_{X}(\sqrt{y})}{\sqrt{y+h}-\sqrt{y}} \lim _{h \rightarrow 0} \frac{\sqrt{y+h}-\sqrt{y}}{h} \\ & =F_{X}^{\prime}(\sqrt{y}) \frac{d}{d y} \sqrt{y} \end{align}
If \(X\) is discrete, it then follows from (8.7) that \(X^{2}\) is discrete, since the distribution function \(F_{X^{2}}(\cdot)\) may be expressed entirely as a sum. The probability mass function of \(X^{2}\) for any real number \(y\) is given by
\begin{align} p_{X^{2}}(y) &= \begin{cases} p_{X}(\sqrt{y}) + p_{X}(-\sqrt{y}), & \text{for } y \geq 0 \\ 0, & \text{for } y < 0 \end{cases} \tag{8.10} \end{align}
Example 8A . The random sine wave . Let \[X=A \sin \theta,\tag{8.11}\] in which the amplitude \(A\) is a known positive constant and the phase \(\theta\) is a random variable uniformly distributed on the interval \(-\pi / 2\) to \(\pi / 2\) . The distribution function \(F_{X}(\cdot)\) for \(|x|is given by \begin{align} F_{X}(x) & =P[A \sin \theta \leq x]=P[\sin \theta \leq x / A] \\ & =P\left[\theta \leq \sin ^{-1}(x / A)\right]=F_{0}\left(\sin ^{-1} \frac{x}{A}\right) \\ & =\frac{1}{\pi}\left[\sin ^{-1}\left(\frac{x}{A}\right)+\frac{\pi}{2}\right]. \end{align} Consequently, the probability density function is given by \begin{align} f_{X}(x) & = \begin{cases} \frac{1}{\pi A}\left(1-\left(\frac{x}{A}\right)^{2}\right)^{-\frac{1}{2}}, & \text{for } |x| \leq A \tag{8.12} \\ 0, & \text{otherwise.} \end{cases} \end{align}
Random variables of the form of (8.11) arise in the theory of ballistics. If a projectile is fired at an angle \(\alpha\) to the earth, with a velocity of magnitude \(v\) , then the point at which the projectile returns to the earth is at a distance \(R\) from the point at which it was fired; \(R\) is given by the equation \(R=\left(v^{2} / g\right) \sin 2 \alpha\) , in which \(g\) is the gravitational constant, equal to \(980 \mathrm{~cm} / \mathrm{sec}^{2}\) or \(32.2 \mathrm{ft} / \mathrm{sec}^{2}\) . If the firing angle \(\alpha\) is a random variable with a known probability law, then the range \(R\) of the projectile is also a random variable with a known probability law.
A random variable similar to the one given in (8.11) was encountered in the discussion of Bertrand’s paradox in section 7; namely, the random variable \(X=2 r \cos Z\) , in which \(Z\) is uniformly distributed over the interval 0 to \(\pi / 2\) .
Example 8B . The positive part of a random variable . Given any real number \(x\) , we define the symbols \(x^{+}\) and \(x^{-}\) as follows:
\begin{align} x^{+} &= \begin{cases} x, & \text{if } x \geq 0 \\[2mm] 0, & \text{if } x < 0 \end{cases} \quad\quad & x^{-} = \begin{cases} 0, & \text{if } x \geq 0 \\[2mm] -x, & \text{if } x < 0 \end{cases} \tag{8.13} \end{align}
Then \(x=x^{+}-x^{-}\) and \(|x|=x^{+}+x^{-}\) . Given a random variable \(X\) , let \(Y=X^{+}\) . We call \(Y\) the positive part of \(X\) . The distribution function of the positive part of \(X\) is given by
\begin{align} F_{X+}(y) & = \begin{cases} 0, & \text{if } y < 0 \tag{8.14} \\ F_{X}(0), & \text{if } y = 0 \\ F_{X}(y), & \text{if } y > 0. \end{cases} \end{align}
Thus, if \(X\) is normally distributed with parameters \(m=0\) and \(\sigma=1\) ,
\begin{align} F_{X+}(y) & = \begin{cases} 0, & \text{if } y < 0 \tag{8.15} \\ \Phi(0)=\frac{1}{2}, & \text{if } y = 0 \\ \Phi(y), & \text{if } y > 0. \end{cases} \end{align}
The positive part \(X^{+}\) of a normally distributed random variable is neither continuous nor discrete but has a distribution function of mixed type.
The Calculus of Probability Density Functions . Let \(X\) be a continuous random variable, and let \(Y=g(X)\) . Unless some conditions are imposed on the function \(g(\cdot)\) , it is not necessarily true that \(Y\) is continuous. For example, \(Y=X^{+}\) is not continuous if \(X\) has a positive probability of being negative. We now state some conditions on the function \(g(\cdot)\) under which \(g(X)\) is a continuous random variable if \(X\) is a continuous random variable. At the same time, we give formulas for the probability density function of \(g(X)\) in terms of the probability density function of \(X\) and the derivatives of \(g(\cdot)\) .
We first consider the case in which the function \(g(\cdot)\) is differentiable at every real number \(x\) and, further, either \(g^{\prime}(x)>0\) for all \(x\) or \(g^{\prime}(x)<0\) for all \(x\) . We may then prove the following facts (see R. Courant, Differential and Integral Calculus , Interscience, New York, 1937, pp. 144145): (i) as \(x\) goes from \(-\infty\) to \(\infty, g(x)\) is either monotone increasing or monotone decreasing; (ii) the limits
\[\begin{array}{ll} \alpha^{\prime}=\displaystyle\lim _{x \rightarrow-\infty} g(x), & \beta^{\prime}=\displaystyle\lim _{x \rightarrow \infty} g(x) \tag{8.16}\\[2mm] \alpha=\min \left(\alpha^{\prime}, \beta^{\prime}\right), & \beta=\max \left(\alpha^{\prime}, \beta^{\prime}\right) \end{array}\]
exist (although they may be infinite); (iii) for every value of \(y\) such that \(\alpha
\[\frac{dx}{dy}=\frac{d}{dy} g^{-1}(y)=\left(\left.\frac{d}{d x} g(x)\right|_{x=g^{-1}(y)}\right)^{-1}=\frac{1}{d y / d x}. \tag{8.17}\]
For example, let \(g(x)=\tan ^{-1} x\) . Then \(g^{\prime}(x)=1 /\left(1+x^{2}\right)\) is positive for all \(x\) . Here \(\alpha=-\pi / 2\) and \(\beta=\pi / 2\) . The inverse function is \(\tan y\) , defined for \(|y| \leq \pi / 2\) . The derivative of the inverse function is given by \(d x / d y=\) \(\sec ^{2} y\) . One sees that \((d y / d x)^{-1}=1+(\tan y)^{2}\) is equal to \(d x / d y\) , as asserted by (8.17). We may now state the following theorem:
If \(y=g(x)\) is differentiable for all \(x\) , and either \(g^{\prime}(x)>0\) for all \(x\) or \(g^{\prime}(x)<0\) for all \(x\) , and if \(X\) is a continuous random variable, then \(Y=g(X)\) is a continuous random variable with probability’ density function given by
\begin{align} f_{Y}(y) & = \begin{cases} f_{X}\left[g^{-1}(y)\right]\left|\frac{d}{d y} g^{-1}(y)\right|, & \text{if } \alpha < y < \beta \tag{8.18} \\ 0, & \text{otherwise.} \end{cases} \end{align}
in which \(\alpha\) and \(\beta\) are defined by (8.16).
To illustrate the use of (8.18), let us note the formula: if \(X\) is a continuous random variable, then
\begin{align} f_{\tan^{-1} X}(y) & = \begin{cases} f_{X}(\tan y) \sec^2 y, & \text{for } |y| < \frac{\pi}{2} \tag{8.19} \\ 0, & \text{otherwise.} \end{cases} \end{align}
To prove (8.18), we distinguish two cases; the case in which the function \(y=g(x)\) is monotone increasing and that in which it is monotone decreasing. In the first case the distribution function of \(Y\) for \(\alpha
\[F_{Y}(y)=P[g(X) \leq y]=P\left[X \leq g^{-1}(y)\right]=F_{X}\left[g^{-1}(y)\right]. \tag{8.20}\]
In the second case, for \(\alpha
\[F_{X}(y)=P[g(X) \leq y]=P\left[X \geq g^{-1}(y)\right]=1-F_{X}\left[g^{-1}(y)\right].\tag{8.20