Expectation and Variance by Integration
The mean and variance of a continuous variable are integrals against the density, and the same linearity rules from the discrete case still hold.
What a learner can do afterwards
- Compute the mean and variance of a continuous variable by integration
- Use linearity of expectation without assuming independence
- Find the expected value of a function of a random variable
1 · Read
A continuous mean is an integral against the density: E[X] is the integral of x times f(x) dx. Variance measures squared distance from the centre: Var = E[X squared] minus the squared mean. Try X uniform on [0, 6] with density 1/6: E[X] is the integral of x over 6 from 0 to 6, which is 36 over 12 = 3. The midpoint shortcut agrees, since 3 sits halfway between 0 and 6.
Finish the spread for that uniform case. You are given E[X squared] = 12 and the mean 3, so Var = 12 minus 9 = 3. Linearity is the superpower here: E[X + Y] = E[X] + E[Y] with no independence small print, and constants slide out. So E[2X + 1] = 2 times 3 + 1 = 7. A friend who demands independence before adding means is wrong.
Functions of a variable ride the same integral: E[g(X)] is the integral of g(x) times f(x) dx. A rate 2 exponential waits with mean 1 over 2 = 0.5 and variance 1 over 4 = 0.25: faster arrivals mean shorter waits. Discrete sums preview all of this, with weights turning into density and sums turning into integrals.
Run the variance recipe in order: mean first, then E[X squared], then subtract the squared mean. The classic slip is reporting E[X squared] as the variance and skipping the subtraction. Always finish that last step.
Integrate x against the density for the mean, then subtract the squared mean from E[X squared] for the variance.
2 · Watch
Take it off screen
Where it sits
Where this leads
Jobs that lean on this skill. Follow one to see everything it is built on.
8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.