iLovePDF Convert your PDF now
How-To

How to Find a CDF from a PDF, With Simple Examples

Learn the link between PDF and CDF with clear formulas and examples.

Ilovepdf Editors 6 min read
How to Find a CDF from a PDF, With Simple Examples

Understanding PDF and CDF Basics

To find a CDF from a PDF, integrate the PDF from negative infinity up to your chosen value. This running area gives the chance that a random value is less than or equal to that value.

For a continuous random variable X, a probability density function is written as fX(x). It shows how tightly probability gathers near each value. A taller curve means more density in that area. It does not give the chance of one exact value.

A cumulative distribution function is written as FX(x). It gives the total probability that X is at most x. Its values range from 0 to 1. The CDF never falls as x moves from left to right.

  • PDF: Shows local density across possible values
  • CDF: Adds all probability up to a chosen value
  • Area: Measures probability over an interval
  • Limits: The CDF approaches 0 on the far left and 1 on the far right

A valid PDF must be nonnegative. Its total area must equal 1. This rule is called normalization. Without it, the curve cannot describe a complete probability model.

The Relationship Between PDF and CDF

Blank paper beside laptop and tablet on an airy desk for PDF and CDF study
PDF and CDF study workspace

The relation between CDF and PDF comes from integration and differentiation. The CDF is the accumulated area under the PDF. The PDF is the rate at which that accumulated area grows.

The central formula is:

FX(x) = ∫−∞x fX(t) dt

The letter t is a temporary input inside the integral. The upper limit x sets the point where you want the CDF value. In plain terms, add every small slice of density from the far left through x.

When the CDF is smooth, you can go back from CDF to PDF by taking its derivative:

fX(x) = dFX(x) / dx

This reverse step works where the derivative exists. A steep CDF means a high PDF value. A flat CDF means little or no density at that point.

A continuous variable also has an important limit. The chance of one exact point is zero, so P(X = x) = 0. Probability comes from an interval, such as P(2 < X ≤ 5). You find that chance by subtracting CDF values:

P(a < X ≤ b) = FX(b) − FX(a)

How to Calculate a CDF from a PDF

Blank worksheet, pencil, and folder arranged for a clear calculation study
Organized calculation desk

To calculate a CDF from a PDF, first find the range where the PDF is nonzero. Then set up the integral with the correct lower and upper limits. Finally, simplify the result and check its limits.

  1. Write the PDF: State fX(x) and its valid range.
  2. Set the bounds: Use negative infinity as the lower bound, or the start of the PDF's support.
  3. Integrate: Find the area from the start through x.
  4. Split the answer: Use separate cases outside and inside the valid range.
  5. Check the result: Confirm that the CDF stays between 0 and 1.

Suppose a PDF is zero below a and above b. For values below a, the CDF equals 0. For values above b, the CDF equals 1. Between a and b, integrate the given formula from a to x.

Normalization matters at this stage. If the PDF has total area 2, its values are twice as large as they should be. You must divide by 2 before using it, if the model calls for that correction.

For a quick check, test three points. The far-left value should give 0. The far-right value should give 1. The CDF should also rise or remain flat, never move downward.

Examples of Finding a CDF from a PDF

Laptop and blank study sheet arranged with folders for probability examples
Probability examples at a tidy desk

Uniform distribution

Let X have a uniform distribution from 2 to 6. Its PDF is fX(x) = 1/4 for 2 ≤ x ≤ 6. The curve forms a flat block with width 4 and height 1/4. Its total area is 1.

For a value between 2 and 6, integrate the constant height:

FX(x) = ∫2x 1/4 dt = (x − 2)/4

So the full CDF is 0 below 2, (x − 2)/4 from 2 through 6, and 1 above 6. For example, FX(5) = 3/4. There is a 75% chance that X is at most 5.

Exponential distribution

Now let X measure waiting time with rate λ greater than 0. Its PDF is fX(x) = λe−λx for x ≥ 0. It is zero for negative x.

Integrating this PDF gives:

FX(x) = 1 − e−λx

This formula applies when x is at least 0. For x below 0, the CDF is 0. If λ = 0.5 and x = 2, then FX(2) = 1 − e−1, or about 0.632.

Graphs make this link easier to see. The uniform PDF stays flat, while its CDF rises in a straight line. The exponential PDF falls over time, while its CDF rises fast at first and then levels off near 1.

When to Use PDF and CDF

Laptop, tablet, and blank paper on a bright desk for choosing data tools
Choosing the right probability tool

Use a PDF when you need to study density across a continuous range. It helps compare likely regions and supports area-based calculations. The height alone is not a probability.

Use a CDF when you need a threshold or percentile. Questions such as “What is the chance of waiting less than five minutes?” need a CDF. The same function helps find median values and risk cutoffs.

QuestionBest toolReason
Where is density highest?PDFIt shows the curve's local height
What is P(X ≤ x)?CDFIt gives total probability up to x
What is P(a < X ≤ b)?CDFSubtract the two endpoint values
How quickly does probability grow?PDFIt is the CDF's slope

For a normal distribution, the PDF shows the bell curve. The normal CDF gives the area to the left of a chosen score. Use the CDF for tail chances, percentiles, and cutoffs.

For a binomial model, use a probability mass function rather than a continuous PDF. It assigns probability to separate counts, such as 7 successes in 10 trials. A binomial CDF adds those point probabilities through a chosen count.

That distinction prevents a common mistake. Continuous models use density and integration. Discrete models use point probabilities and sums. Both CDF types still answer a cumulative question.

A Quick Way to Check Your Result

After you find a CDF from a PDF, review its shape before using it. The function should start near 0 and end near 1. It should never decrease as x grows.

Differentiate your answer when possible. The result should match the original PDF within its valid range. Also test the boundary points. A jump or mismatch often signals a missing case.

  • Check that the PDF is nonnegative
  • Check that its full area equals 1
  • Check that FX(−∞) approaches 0
  • Check that FX(∞) approaches 1
  • Check that every CDF value lies between 0 and 1

The main method is simple: identify the density, integrate up to x, and apply the correct range. This is how to get a CDF from a PDF in nearly every continuous model.

find cdf from pdfcalculate cdf from pdfrelation between cdf and pdfcontinuous random variablesarea under the curve

Related reading

Cookies on iLovePDF We keep a couple of cookies so the PDF tools work and so we can see which guides help. Choose what you are comfortable with — you can change it any time. Read the cookie policy.