A-Level Further Maths 9231 / Topic 4.1 / AS & A Level
Change the variable, keep the probability.
Once you have the pdf of \(X\), one integral gives the mean of any function of it: \(E(X^{2})\), \(E(1/X)\), \(E(\sqrt{X})\) or \(E(e^{X})\). And if \(Y\) is a function of \(X\), the CDF carries the probabilities straight across: \(P(Y \le y)\) is a statement about \(X\), so the CDF of \(Y\) comes from the CDF of \(X\), and differentiating gives its pdf.
For a continuous random variable \(X\) with pdf \(f(x)\), the general result is \(E\big(g(X)\big) = \displaystyle\int g(x)\,f(x)\,dx\) over the range of \(X\); in particular \(\operatorname{Var}(X) = E(X^{2}) - [E(X)]^{2}\). For \(Y = g(X)\) with \(g\) increasing, \(G(y) = P(Y \le y) = P\big(X \le g^{-1}(y)\big) = F\big(g^{-1}(y)\big)\); for \(g\) decreasing the inequality flips, so \(G(y) = 1 - F\big(g^{-1}(y)\big)\). Differentiate \(G\) to get the pdf of \(Y\), and always state the new range of \(y\).
Fig. 1: the pdf of X (left) and the pdf of Y = X^3 (right). The shaded areas are both 0.5: the median of Y is the cube of the median of X, but the shapes are very different
Section 01
One integral for any function of X.
You already know \(E(X) = \displaystyle\int x f(x)\,dx\). The same idea works for any function: weight each value \(g(x)\) by the density \(f(x)\) and integrate over the range of \(X\). This is the general result \(E\big(g(X)\big) = \displaystyle\int g(x)\,f(x)\,dx\). You do NOT need the distribution of \(g(X)\) to find its mean.
\(X\) has pdf \(f(x) = 2x\) for \(0 \le x \le 1\) and 0 otherwise. Find \(E\!\left(\dfrac{1}{X}\right)\) and \(E(\sqrt{X})\), and compare \(E\!\left(\dfrac{1}{X}\right)\) with \(\dfrac{1}{E(X)}\).
\(E(X) = \displaystyle\int_{0}^{1} 2x^{2}\,dx = \tfrac{2}{3}\), so \(\dfrac{1}{E(X)} = \tfrac{3}{2}\), which is NOT \(E\!\left(\dfrac{1}{X}\right) = 2\).
Only LINEAR functions pass through \(E\): \(E(2X + 1) = 2E(X) + 1\), but \(E(X^{2}) \ne [E(X)]^{2}\), \(E(1/X) \ne 1/E(X)\) and \(E(\sqrt{X}) \ne \sqrt{E(X)}\). For anything non-linear, integrate \(g(x)f(x)\).
Section 02
From F to G: increasing functions.
Now suppose you want the whole distribution of \(Y = g(X)\), not just its mean. The safe route is through the CDF, because \(P(Y \le y)\) can be rewritten as a statement about \(X\). If \(g\) is increasing on the range of \(X\), then \(Y \le y\) exactly when \(X \le g^{-1}(y)\).
Range: map the ends of the range of \(X\) through \(g\) to get the range of \(Y\).
This matches \(E(X^{2}) = \tfrac{12}{5}\) from the first worked example (the same \(X\)), as the general result says it must.
Answer: \(g(y) = \frac{3}{16}\sqrt{y}\) for \(0 \le y \le 4\), and \(E(Y) = \frac{12}{5}\)
Your turn
\(X\) has CDF \(F(x) = \dfrac{x}{2}\) for \(0 \le x \le 2\). Find the pdf of \(Y = X^{3}\).
\(G(y) = F(y^{1/3}) = \tfrac{1}{2}y^{1/3}\), so \(g(y) = \tfrac{1}{6}y^{-2/3}\) for \(0 < y \le 8\), 0 otherwise.
Examiner trap
Do not substitute \(x = y^{1/3}\) into the pdf \(f(x)\): that skips the chain rule factor and the result does not integrate to 1. Go through the CDF, and write the NEW range of \(y\), not the old range of \(x\).
Stage 1 · Learn
Check your understanding
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
\(X\) has pdf \(f(x) = 2x\) for \(0 \le x \le 1\). Find \(E(X^{2})\).
Quick check+10 XP
\(E(X) = 3\) and \(E(X^{2}) = 10\). Find \(\operatorname{Var}(X)\).
Quick check+10 XP
\(X\) is positive with CDF \(F(x)\), and \(Y = X^{3}\). Which expression is the CDF \(G(y)\) of \(Y\)?
Quick check+10 XP
\(X\) is positive with CDF \(F(x)\), and \(Y = \dfrac{1}{X}\). Which expression is \(G(y) = P(Y \le y)\)?
Section 03
Decreasing functions and medians.
If \(g\) is decreasing, a small \(Y\) comes from a large \(X\), so the inequality turns round: \(Y \le y\) exactly when \(X \ge g^{-1}(y)\). That gives \(G(y) = 1 - F\big(g^{-1}(y)\big)\). The commonest case is \(Y = \dfrac{1}{X}\) with \(X\) positive.
\(Y = \dfrac{1}{X}\), \(X > 0\): \(G(y) = P\!\left(X \ge \dfrac{1}{y}\right) = 1 - F\!\left(\dfrac{1}{y}\right)\). The ends of the range swap over.
Medians: for a monotonic \(g\), half the probability stays on each side, so the median of \(Y\) is \(g(m)\), where \(m\) is the median of \(X\). (Means do not behave like this.)
A pdf that comes out negative means you forgot to flip the inequality.
Worked example Y = 1/X
\(X\) has pdf \(f(x) = \dfrac{2}{x^{2}}\) for \(1 \le x \le 2\). Find the CDF of \(Y = \dfrac{1}{X}\) and identify the distribution of \(Y\).
\(F(x) = \displaystyle\int_{1}^{x} \tfrac{2}{t^{2}}\,dt = 2 - \tfrac{2}{x}\) for \(1 \le x \le 2\).
\(x = 1 \to y = 1\) and \(x = 2 \to y = \tfrac{1}{2}\), so \(\tfrac{1}{2} \le y \le 1\).
Directly: \(1 - \dfrac{1}{m^{2}} = \dfrac{1}{2}\), so \(m = \sqrt{2}\).
Via \(X\): \(x^{2} = \tfrac{1}{2}\) gives median \(\tfrac{1}{\sqrt{2}}\) for \(X\), and \(1 \big/ \tfrac{1}{\sqrt{2}} = \sqrt{2}\). They agree.
Answer: \(g(y) = \frac{2}{y^{3}}\) for \(y \ge 1\); the median of \(Y\) is \(\sqrt{2}\)
Examiner trap
With a decreasing function, \(G(y) = F\big(g^{-1}(y)\big)\) is WRONG: in the first example it gives \(2 - 2y\), which falls as \(y\) rises, so it cannot be a CDF, and its derivative \(-2\) is negative. Flip the inequality: \(G(y) = 1 - F\big(g^{-1}(y)\big)\).
Stage 2 · Exam
Exam-style questions
Unlocks once the four checks above are done. Worth more XP, written to AS & A Level Further Mathematics Paper 1 to 4 standard.
Finish the four checks above to unlock the exam questions
Exam style+20 XP
\(X\) has pdf \(f(x) = \dfrac{3}{16}\sqrt{x}\) for \(0 \le x \le 4\). Find \(E(\sqrt{X})\).
Exam style+20 XP
\(X\) has CDF \(F(x) = \dfrac{x^{2}}{9}\) for \(0 \le x \le 3\). Find the pdf of \(Y = X^{3}\).
Exam style+20 XP
The positive random variable \(X\) has median 1.6. Find the median of \(Y = X^{2}\).
Exam style+20 XP
\(X\) has CDF \(F(x) = 2 - \dfrac{2}{x}\) for \(1 \le x \le 2\). Find the CDF of \(Y = \dfrac{1}{X}\).
Skill unlocked
Expectations integrated, related variables found.
This skill is now recorded on your profile. Keep the chain going.