Integrate on the correct branch and keep a cumulative distribution continuous. Normalise a density and compute probabilities and moments by integration.
Notes and key methods
Normalise a piecewise density by adding its separate integrals. The cumulative distribution \(F(x)=P(X\le x)\) must include all area to the left, including completed earlier pieces.
For an absolutely continuous variable, F is continuous, nondecreasing, zero below the support and one above it. At a point where f changes formula, match the two CDF expressions rather than resetting the accumulated probability.
A density f is nonnegative and integrates to one over its support. Probabilities are areas: \(P(a<X<b)=\int_a^b f(x)\,dx\). A density may be larger than 1; a probability cannot.
Use \(E(X)=\int xf(x)\,dx\), \(E(X^2)=\int x^2f(x)\,dx\) and \(\operatorname{Var}(X)=E(X^2)-E(X)^2\). A median m solves \(\int_{-\infty}^m f(x)\,dx=1/2\).
Check the conditions
Integrate separately across every density breakpoint.
A continuous density model has no positive point masses at breakpoints.
State the full support and put f(x)=0 outside it.
The density must be nonnegative throughout its support.
Three worked examples
Example 1 · Piecewise densities and cumulative functions
The density is \(f(x)=kx\ (0\le x\le 4),\quad f(x)=k(8-x)\ (4<x\le 8)\), and zero elsewhere.
Use the labelled scales alongside the numerical method.
Find k.
Find E(X).
Find Var(X).
Find P(X≤1).
Show the reasoning
(a)
\(k(4^2/2+4^2/2)=1\implies k=\frac{1}{16}\)
Answer: \(\frac{1}{16}\).
(b)
\(E(X)=4\) by symmetry about the centre of the support.
Answer: \(4\).
(c)
\(\int(x-E(X))^2f(x)\,dx=\frac{8}{3}\)
Answer: \(\frac{8}{3}\).
(d)
\(\int_0^1x/16\,dx=\frac{1}{32}\)
Answer: \(\frac{1}{32}\).
Example 2 · Continuous densities and moments
X has density \(f(x)=kx^{1}\) for \(0\le x\le 5\) and zero elsewhere.
Use the labelled scales alongside the numerical method.
Find k.
Find E(X).
Find Var(X).
Find the median of X.
Show the reasoning
(a)
\(k\frac{5^{2}}{2}=1\implies k=\frac{2}{25}\)
Answer: \(\frac{2}{25}\).
(b)
\(\int_0^L xf(x)\,dx=\frac{10}{3}\)
Answer: \(\frac{10}{3}\).
(c)
\(E(X^2)-E(X)^2=\frac{25}{18}\)
Answer: \(\frac{25}{18}\).
(d)
\((m/5)^{2}=1/2\implies m=52^{-1/2}\)
Answer: \(3.53553390593274\).
Example 3 · Piecewise densities and cumulative functions
The density is \(f(x)=kx\ (0\le x\le 6),\quad f(x)=k(12-x)\ (6<x\le 12)\), and zero elsewhere.
Use the labelled scales alongside the numerical method.
Find k.
Find E(X).
Find Var(X).
Find P(X≤1).
Show the reasoning
(a)
\(k(6^2/2+6^2/2)=1\implies k=\frac{1}{36}\)
Answer: \(\frac{1}{36}\).
(b)
\(E(X)=6\) by symmetry about the centre of the support.
Answer: \(6\).
(c)
\(\int(x-E(X))^2f(x)\,dx=6\)
Answer: \(6\).
(d)
\(\int_0^1x/36\,dx=\frac{1}{72}\)
Answer: \(\frac{1}{72}\).
Common mistakes
Do not omit the accumulated area from an earlier branch.
A derivative of F gives the density only on the appropriate support.