Why Expected Value Uses an Integral
For a discrete random variable, the expected value is a probability-weighted sum of its possible values. A continuous random variable can take values throughout an interval, so its probabilities are described by a density rather than by a list of point probabilities. Expected value is therefore calculated by integrating each possible value, weighted by the density, over the variable’s support.
The result is the distribution’s mean: a measure of its central location. It is not necessarily a value the random variable can actually take, and it does not describe the outcome of every individual observation. The calculation depends on using a valid density and integrating over the full support.
A probability density must be nonnegative and have total integral one. These conditions matter before calculating an expected value: an expression that fails either condition is not a probability density. The support is the set of values where the density can be positive; always use its limits, not limits chosen merely because they make the algebra convenient.
Why the Integral Gives the Mean
The expectation of a random variable is its integral with respect to the probability distribution. When that distribution has density \(f_X\), probability assigned to a set \(A\) is \(\int_A f_X(x)\,dx\). Thus the probability-weighted contribution from values in a small region is represented by the value \(x\) multiplied by the probability density there. Integrating those contributions over all possible values gives the expected value.
More formally, the probability measure of \(X\) has density \(f_X\) with respect to length on the real line. The change from integration with respect to that probability measure to integration with respect to length is precisely multiplication by \(f_X(x)\):
This identity is the density form of the definition of expectation; it does not require the density to be continuous. If the support is bounded and the density is Riemann-integrable, the formula can also be understood through Riemann sums: partition the support into short intervals, weight a representative value in each interval by the probability in that interval, and refine the partition. That Riemann-sum explanation requires the stated regularity; the probability-measure integral is the general justification.
A Reliable Calculation Process
For a density given with an unknown constant, determine that constant before finding the mean. Then multiply the density by \(x\) and integrate over the support. Keeping these steps separate makes it easier to catch a normalization error or an incorrect integration limit.
Write down the values \(X\) can take. Values outside this range contribute nothing to the integral.
Confirm nonnegativity and set the total integral equal to one if a normalizing constant is unknown.
Use \(x f_X(x)\), not the density alone, as the integrand.
Integrate over the full support and compare the result with the range of possible values.
Worked Calculations
Worked Example: A Density With an Unknown Constant
A hypothetical continuous measurement \(X\), in units, has density \(f_X(x)=c(x+1)\) for \(-1\leq x\leq 2\), and zero elsewhere. Find \(c\) and \(E[X]\). The model is specified by this density and support; no interest or mortality assumptions apply.
Method: normalize first, then integrate \(x f_X(x)\). The proposed density is nonnegative on \([-1,2]\), since \(x+1\geq 0\) there. To find \(c\), require its integral to be one:
At \(x=2\), the antiderivative is \(2+2=4\). At \(x=-1\), it is \(\frac12-1=-\frac12\). Therefore the integral is \(4-(-\frac12)=\frac92\), giving \(c=\frac29\). This value is positive, as required.
Now calculate the expected value:
At \(x=2\), the antiderivative is \(\frac83+2=\frac{14}{3}\). At \(x=-1\), it is \(-\frac13+\frac12=\frac16\). Their difference is \(\frac{14}{3}-\frac16=\frac{28}{6}-\frac16=\frac{27}{6}=\frac92\). Hence
The support is \([-1,2]\), and the mean \(1\) lies within it, which is a useful check. Common mistake avoided: integrating \(f_X(x)\) again when calculating the mean only verifies total probability; the expectation integrand must be \(x f_X(x)\).
Worked Example: Expected Hypothetical Repair Severity
For a hypothetical repair portfolio, let \(X\) denote a repair cost measured in thousands of dollars. Suppose its density is \(f_X(x)=c(2-x)\) for \(0\leq x\leq 2\), and zero elsewhere. Find \(c\) and the expected repair cost. This is a specified continuous severity model on \([0,2]\); no mortality or interest assumption is part of the calculation.
Method: use the total-probability condition, then integrate over the severity range. Since \(2-x\geq0\) on the support, nonnegativity holds when \(c\geq0\). Normalization gives
Thus \(c=\frac12\). The expected severity, still in thousands of dollars, is
At the upper endpoint the antiderivative equals \(4-\frac83=\frac43\), and at zero it is zero. Therefore \(E[X]=\frac12\cdot\frac43=\frac23\) thousand dollars, or \(\$666.67\) to the nearest cent. The possible severity ranges from zero to two thousand dollars, so an expected severity of two-thirds of a thousand dollars is within the support. The money conversion is made only after the integral is evaluated.
Common mistake avoided: reporting \(\frac23\) as dollars would ignore the problem’s units. The integral gives \(\frac23\) thousand dollars, which is \(\$666.67\) when rounded to cents.
Worked Example: A Piecewise Density
A hypothetical continuous operating-time variable \(X\), measured in hours, has density \(f_X(x)=cx\) for \(0\leq x\leq1\), \(f_X(x)=c(3-x)/2\) for \(1<x\leq3\), and zero elsewhere. Find \(c\) and \(E[X]\). The support is \([0,3]\), and the specified distribution has no additional parameters or actuarial assumptions.
Method: split each integral where the density changes formula. Both pieces are nonnegative on their stated intervals. For normalization,
The bracketed difference is \((9-\frac92)-(3-\frac12)=\frac92-\frac52=2\). The total integral is therefore \(c(\frac12+1)=\frac32c\), so \(c=\frac23\).
For the mean, multiply each piece by \(x\):
The first integral is \(\frac13\). For the second, \(\int x(3-x)\,dx=\frac{3x^2}{2}-\frac{x^3}{3}\), so
Consequently,
The result is between the support endpoints zero and three hours. Common mistake avoided: using one formula across the whole support would give the wrong integral because the density changes at \(x=1\).
Checks and Common Traps
For a bounded support \([a,b]\), the expected value must lie between \(a\) and \(b\). Since \(a\leq x\leq b\) throughout the support and the density is nonnegative, multiplying by \(f_X(x)\) and integrating gives
A valid density has total integral one, so this reduces to \(a\leq E[X]\leq b\). A result outside the support signals an error in the density, limits, algebra, or units.
The most important distinction is between probability and expectation. Integrating \(f_X(x)\) over a region calculates a probability. Integrating \(x f_X(x)\) over the support calculates the mean. For example, in the repair-severity model, \(\int_0^2 f_X(x)\,dx=1\), whereas \(\int_0^2 x f_X(x)\,dx=\frac23\) thousand dollars.
Other useful checks include confirming that a proposed density is nonnegative, checking that its integral is one, splitting an integral wherever a piecewise formula changes, and keeping the units of \(X\) in the final answer. A density’s value at a single endpoint does not change either integral; changing a function at finitely many points does not affect its integral. The support and the density over intervals, rather than an isolated endpoint value, determine the calculation.
Check Your Understanding
For each model, verify the density as needed and calculate the expected value. Answers are provided for checking.
- A continuous measurement \(X\) has density \(f_X(x)=c\) for \(2\leq x\leq8\), and zero elsewhere. Find \(c\) and \(E[X]\). (Answer: \(c=\frac16,\ E[X]=5\).)
- A hypothetical continuous cost \(X\), in thousands of dollars, has density \(f_X(x)=c(4-x)\) for \(0\leq x\leq4\), and zero elsewhere. Find \(c\) and the expected cost. (Answer: \(c=\frac18,\ E[X]=\frac43\) thousand dollars.)
- A continuous variable \(X\) has density \(f_X(x)=cx^2\) for \(0\leq x\leq3\), and zero elsewhere. Determine \(c\) and \(E[X]\). (Answer: \(c=\frac19,\ E[X]=\frac94\).)
- A continuous operating time \(X\), in hours, has density \(f_X(x)=c\) for \(0\leq x\leq1\), \(f_X(x)=c(3-x)/2\) for \(1<x\leq3\), and zero elsewhere. Find \(c\) and \(E[X]\), splitting the integrals at the change in formula. (Answer: \(c=\frac12,\ E[X]=\frac{13}{12}\) hours.)
- A hypothetical severity \(X\), in thousands of dollars, has density \(f_X(x)=cx\) for \(0\leq x\leq2\), and zero elsewhere. Find \(c\) and the expected severity in dollars to the nearest cent. (Answer: \(c=\frac12,\ E[X]=\frac43\) thousand dollars \(=\$1,333.33\).)