Salam Academy
Continuous probability distributions · Subtopic 3 of 4

Mean and Variance of a Continuous Variable

Swap the sum for an integral: E(X)=∫xf(x) dxE(X)=\int xf(x)\,dx and E(X2)=∫x2f(x) dxE(X^2)=\int x^2f(x)\,dx, then Var(X)=E(X2)−[E(X)]2\text{Var}(X)=E(X^2)-[E(X)]^2 exactly as before. For a symmetric pdf, the mean is simply the centre.

Cambridge 9709 Paper 6Cambridge 9231 Paper 4Edexcel YMA01 WST02Edexcel 9FM0 OptionAQA 7367 Paper 3≈ 35 minRevision 5 · updated 2026-10-27
Section 1 of 14

Learning objectives

  • Calculate E(X)=∫xf(x) dxE(X)=\int xf(x)\,dx.
  • Calculate E(X2)E(X^2) and Var(X)=E(X2)−[E(X)]2\text{Var}(X)=E(X^2)-[E(X)]^2.
  • Use symmetry to write down the mean.
  • Use E(aX+b)E(aX+b) and Var(aX+b)\text{Var}(aX+b) for continuous variables.
Pause and think

For a discrete variable, E(X)=∑xP(X=x)E(X)=\sum xP(X=x). A continuous variable has no individual probabilities. What should replace the sum?

Section 2 of 14

Core idea

Start hereThe balance point of a shape

Cut the shape under a pdf out of card and balance it on a pencil. The balance point is the mean. For discrete variables we summed x×x\timesprobability; for continuous ones, we integrate.

The big idea

E(X)=∫xf(x) dxE(X)=\int xf(x)\,dx; E(X2)=∫x2f(x) dxE(X^2)=\int x^2f(x)\,dx; Var⁡(X)=E(X2)−[E(X)]2\operatorname{Var}(X)=E(X^2)-[E(X)]^2.

1. From sums to integrals

Strip by strip
  1. P(x<X<x+δx)≈f(x) δxP(x<X<x+\delta x)\approx f(x)\,\delta x
    Thin strip of area.
  2. E(X)≈∑x f(x) δxE(X)\approx\sum x\,f(x)\,\delta x
    Discrete formula with these probabilities.
  3. E(X)=∫xf(x) dxE(X)=\int xf(x)\,dx
    Limit of the sum.
f(x) = x/2 on [0, 2] balances at E(X) = 4/3
0.511.520.20.40.60.810xf(x)f(x) = x/2E(X) = 4/3
More of the area is on the right, so the balance point is right of the middle: ∫02x⋅x2 dx=[x36]02=43\displaystyle\int_0^2x\cdot\frac x2\,dx=\left[\frac{x^3}{6}\right]_0^2=\frac43.
Worked examplef(x)=x2f(x)=\tfrac x2 on [0,2][0,2]

Find E(X)E(X) and Var⁡(X)\operatorname{Var}(X).

Goal
Values.
Strategy
Integrate.
  1. E(X)=∫02x22dx=[x36]02=43E(X)=\int_0^2\tfrac{x^2}2dx=\left[\tfrac{x^3}6\right]_0^2=\tfrac43
    Mean.
  2. E(X2)=∫02x32dx=[x48]02=2E(X^2)=\int_0^2\tfrac{x^3}2dx=\left[\tfrac{x^4}8\right]_0^2=2
    Second moment.
  3. Var⁡=2−169=29\operatorname{Var}=2-\tfrac{16}9=\tfrac29
    Formula.
AnswerE=43E=\frac43, Var⁡=29\operatorname{Var}=\frac29.
✓ CheckMean right of the midpoint 11, since density increases ✓.
Common misconceptionE(X2)E(X^2) uses x2f(x)x^2f(x) Not (xf(x))2(xf(x))^2.
Pause and think

Uniform on [0,10][0,10]: mean?

Summary

  • ∫xf\int xf, ∫x2f\int x^2f.
  • Var =E(X2)−E(X)2=E(X^2)-E(X)^2.
Key words
Expectation
Balance point.
HistoryCentres of mass. ∫xf(x) dx\int xf(x)\,dx is exactly the formula for the centre of mass of a thin rod whose density is f(x)f(x), which Archimedes studied (without calculus) over 20002000 years ago. Statisticians borrowed the idea, and even the word "moment" comes from mechanics.
Fun factA mean that doesn't exist. Some pdfs have no mean at all. For the Cauchy distribution, ∫xf(x) dx\int xf(x)\,dx diverges: averages of samples from it never settle down, no matter how many values you take. Exam pdfs are always well-behaved, but nature isn't always.
Keep reading for free

Create a free account to read the rest of this lesson: key formulae, worked examples, explore the graph, common mistakes, exam tip, guided practice and more. Your answers are checked and your progress is saved.