expectation of a continuous random variable
For a discrete variable you sum value times probability. But a continuous variable — a waiting time, a height, a temperature — takes uncountably many values, each with probability exactly zero, so there is nothing to put into a sum. How do we average that? We replace the sum by an integral, the continuous version of adding up infinitely many tiny pieces.
If X has probability density function f(x), then E[X] = integral from -infinity to infinity of x times f(x) dx. The picture is the same as the discrete case: f(x) dx is the probability of landing in a tiny sliver of width dx near x, so x times f(x) dx is 'value times its little chunk of probability', and the integral sweeps that across the whole line. As before, E[X] is the centre of mass of the density — the x-coordinate where a cardboard cutout of the density curve would balance on a knife edge.
Two honest cautions. First, the density f(x) is not a probability; it can exceed 1, and only its area over an interval is a probability — but inside the integral the dx restores the units so x times f(x) dx behaves like value times probability. Second, the integral must actually converge. For the Cauchy density the integral of x f(x) dx diverges, so the expectation does not exist at all — a continuous variable with a perfectly nice bell-like shape can still have no mean.
X is uniform on [0, 10] with density f(x) = 1/10 for 0 <= x <= 10. Then E[X] = integral from 0 to 10 of x (1/10) dx = (1/10)(x^2/2) from 0 to 10 = (1/10)(50) = 5 — exactly the midpoint, as symmetry demands.
Integrate x times the density: the continuous analogue of summing value times probability.
A continuous variable can have no mean: if the integral of x f(x) dx diverges (as for the Cauchy distribution), E[X] is undefined, not infinite.