Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Find the CDF from a PDF

For a continuous variable, F(x)=P(X≤x)F(x) = P(X \leq x) is the area under the density to the left of xx. You find it by integrating the pdf from the left end of the support up to xx.

Recognize the task

You have a density f(x)f(x) and need P(X≤x)P(X \leq x), an interval probability, a median or percentile, or the CDF itself. Typical forms: f(x)=2xf(x) = 2x on [0,1][0, 1], f(x)=1b−af(x) = \frac{1}{b - a} on [a,b][a, b], f(x)=λe−λxf(x) = \lambda e^{-\lambda x} for x≥0x \geq 0. Test: is the variable continuous, given by a formula you can integrate? Then the CDF is an integral with variable upper limit.
The continuous CDF is defined in the lesson section Continuous Random Variables.

Two ways to do it

Integrate from the left endusual
F(x)=∫axf(t) dt(a=left end of the support)F(x) = \int_{a}^{x} f(t) \, dt \quad (a = \text{left end of the support})
A definite integral with xx as the upper limit (CDF from PDF).
Antiderivative plus a constantcheck
F(x)=G(x)+C,F(a)=0F(x) = G(x) + C, \quad F(a) = 0
Any antiderivative GG of ff works; fix CC so that FF starts at 00. Differentiating back gives ff (PDF as the CDF derivative).

Steps

StepOn f(x)=2xf(x) = 2x on [0,1][0, 1]
1Write down the support. Find where f(x)>0f(x) > 0. Outside it the density is 00.support [0,1][0, 1]
2Integrate from the left end up to x. Rename the integration variable tt so it does not clash with the limit xx. Evaluate with the Fundamental Theorem of Calculus.F(x)=∫0x2t dt=x2F(x) = \int_0^x 2t \, dt = x^2 for 0≤x≤10 \leq x \leq 1
3Add the pieces outside the support. F(x)=0F(x) = 0 left of the support and F(x)=1F(x) = 1 right of it. Check that the middle piece reaches 11 at the right end.F(x)=0F(x) = 0 for x<0x < 0, x2x^2 on [0,1][0, 1], 11 for x>1x > 1; F(1)=1F(1) = 1 ✓
4Use the CDF for probabilities. Subtract two values: P(a<X≤b)=F(b)−F(a)P(a < X \leq b) = F(b) - F(a). For a continuous variable << and ≤\leq give the same answer.P(0.5<X≤1)=1−0.25=0.75P(0.5 < X \leq 1) = 1 - 0.25 = 0.75

Worked examples

Example 1 · uniform on an interval

linear CDF
f(x)=14f(x) = \frac{1}{4} on [2,6][2, 6]
flat density, width 4
F(x)=∫2x14 dt=x−24F(x) = \int_2^x \frac{1}{4} \, dt = \frac{x - 2}{4}
integrate from the left end
P(X≤5)=F(5)=34P(X \leq 5) = F(5) = \frac{3}{4}
substitute

Example 2 · a polynomial density

power rule
f(x)=3x2f(x) = 3x^2 on [0,1][0, 1]
F(x)=∫0x3t2 dt=x3F(x) = \int_0^x 3t^2 \, dt = x^3
antiderivative t3t^3
P(0.5<X≤1)=1−0.125=0.875P(0.5 < X \leq 1) = 1 - 0.125 = 0.875
F(1)−F(0.5)F(1) - F(0.5)

Example 3 · an exponential waiting time

unbounded
f(x)=0.5e−0.5xf(x) = 0.5 e^{-0.5x} for x≥0x \geq 0
rate λ=0.5\lambda = 0.5
F(x)=∫0x0.5e−0.5t dt=1−e−0.5xF(x) = \int_0^x 0.5 e^{-0.5t} \, dt = 1 - e^{-0.5x}
antiderivative −e−0.5t-e^{-0.5t}
P(X≤2)=1−e−1≈0.6321P(X \leq 2) = 1 - e^{-1} \approx 0.6321
rounded to 4 places
Named densities have ready-made CDFs; see exponential probability and the continuous distributions calculator.

See it happen

Slide a vertical line across the graph of the density from left to right. The shaded area to its left is F(x)F(x). It starts at 00, grows fastest where the density is tallest, and stops at 11 once the whole area is covered. That is why the slope of the CDF is the density. Slide the line yourself in the continuous CDF visualizer.

Common mistakes

Using x as both the limit and the variable

✗ F(x)=∫0x2x dx=2x2F(x) = \int_0^x 2x \, dx = 2x^2
✓ F(x)=∫0x2t dt=x2F(x) = \int_0^x 2t \, dt = x^2

An antiderivative that does not start at 0

✗ f(x)=14f(x) = \frac{1}{4} on [2,6][2, 6], so F(x)=x4F(x) = \frac{x}{4}
✓ F(2)F(2) must be 00: F(x)=x−24F(x) = \frac{x - 2}{4}

Reading the density as a probability

✗ f(x)=3x2f(x) = 3x^2, so P(X=1)=f(1)=3P(X = 1) = f(1) = 3
✓ P(X=1)=0P(X = 1) = 0; probabilities are areas, F(b)−F(a)F(b) - F(a)
A density can exceed 11; a probability cannot.