Continuous Distributions: Areas Under the PDF

April 13, 2026

Problem

A continuous random variable on [0, 1] has PDF f(x) = 2x. Find P(0.3 < X < 0.7). Show the shaded area under the curve and verify the PDF integrates to 1.

Explanation

Discrete vs. continuous

For a continuous random variable, individual values have probability zero (there are uncountably many). Instead, we specify a probability density function (PDF) f(x)f(x), and probabilities are areas under the curve: P(aXb)=abf(x)dxP(a \le X \le b) = \int_a^b f(x) \, dx

Any valid PDF satisfies f(x)0f(x) \ge 0 and f(x)dx=1\int_{-\infty}^{\infty} f(x) \, dx = 1.

Because P(X=a)=aafdx=0P(X = a) = \int_a^a f \, dx = 0, strict and non-strict inequalities give the same probability: P(a<X<b)=P(aXb)P(a < X < b) = P(a \le X \le b).

Step-by-step solution

The PDF: f(x)=2xf(x) = 2x on [0,1][0, 1], and 00 elsewhere.

Step 1 — Verify it is a valid PDF. 012xdx=[x2]01=1\int_0^1 2x \, dx = \left[ x^2 \right]_0^1 = 1 \checkmark

and f(x)=2x0f(x) = 2x \ge 0 on [0,1][0, 1]. ✓

Step 2 — Set up the target probability. P(0.3<X<0.7)=0.30.72xdxP(0.3 < X < 0.7) = \int_{0.3}^{0.7} 2x \, dx

Step 3 — Evaluate the integral. 2xdx=x2+C\int 2x \, dx = x^2 + C [x2]0.30.7=0.490.09=0.40\left[ x^2 \right]_{0.3}^{0.7} = 0.49 - 0.09 = \boxed{0.40}

So there is a 40% chance that XX falls between 0.30.3 and 0.70.7.

Sanity check

The PDF grows linearly, so more mass sits near x=1x = 1. Our interval [0.3,0.7][0.3, 0.7] contains the middle — enough of the bulk for 40%\approx 40\% to feel right. Compare: P(0<X<0.5)=0.25P(0 < X < 0.5) = 0.25 (less, because the left tail is low density) and P(0.5<X<1)=0.75P(0.5 < X < 1) = 0.75 (more, because the right tail is denser). All consistent.

The cumulative distribution function (CDF)

F(x)=P(Xx)=xf(t)dtF(x) = P(X \le x) = \int_{-\infty}^x f(t) \, dt. For our PDF: F(x)={0x<0x20x11x>1F(x) = \begin{cases} 0 & x < 0 \\ x^2 & 0 \le x \le 1 \\ 1 & x > 1 \end{cases}

Then P(0.3<X<0.7)=F(0.7)F(0.3)=0.490.09=0.40P(0.3 < X < 0.7) = F(0.7) - F(0.3) = 0.49 - 0.09 = 0.40, matching the integral.

Key moments

Expected value: E(X)=01x2xdx=012x2dx=23E(X) = \int_0^1 x \cdot 2x \, dx = \int_0^1 2x^2 \, dx = \tfrac{2}{3}

Variance: E(X2)(E(X))2=012x3dx(2/3)2=1249=118E(X^2) - (E(X))^2 = \int_0^1 2x^3 \, dx - (2/3)^2 = \tfrac{1}{2} - \tfrac{4}{9} = \tfrac{1}{18}

Common mistakes

  • Treating f(x)f(x) like a probability. It is a density — values can exceed 1 (e.g. f(0.9)=1.8f(0.9) = 1.8 here). Only the area is a probability.
  • Forgetting the endpoint doesn't matter. For continuous XX, P(X=0.3)=0P(X = 0.3) = 0, so strict vs. non-strict inequality is identical.
  • Integrating over the wrong interval. If ff is zero outside [0,1][0, 1], an integral that strays outside just contributes zero — but be explicit about the support.

Try it in the visualization

Drag the two endpoints aa and bb along the PDF curve. The shaded area shades in real time, and a readout shows the corresponding probability computed from F(b)F(a)F(b) - F(a). Toggle to a different PDF (uniform, linear, or triangular) and watch how the shape of ff changes the answer.

Interactive Visualization

Parameters

Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day