MATH 141 Calculus 2 • McGill University, Montreal

Revision sheet: probability density functions (MATH 141)

This sheet is not a summary of section 8.5 of Stewart: you already have the course notes. It answers one question only, what makes students lose marks on probability density functions in MATH 141 at McGill University, and which precise gesture avoids each loss.

Every number below is exact and done by hand, as on the calculator-free exam. Each integral quoted has been checked twice, by its primitive and by an independent computation.

The thread of the chapter

A probability is an AREA under the density, never a HEIGHT of it: kk comes from the total area 11, FF is the area accumulated from −∞-\infty, the median cuts the area in half, and the mean is a balance point whose integral must converge before any symmetry is used.

This chapter is part of MATH 141, Calculus 2 (McGill)

The essentials

Area, never height

  • • ff is a density when f(x)≥0f(x) \ge 0 for EVERY xx and ∫−∞∞f(x) dx=1\int_{-\infty}^{\infty} f(x)\,dx = 1. Two conditions, checked separately.
  • • P(a≤X≤b)=∫abf(x) dxP(a \le X \le b) = \int_a^b f(x)\,dx. A single point has no width: P(X=a)=0P(X = a) = 0, so << and ≤\le give the same probability.
  • • f(x)f(x) is a probability PER UNIT LENGTH: P(x≤X≤x+Δx)≈f(x) ΔxP(x \le X \le x + \Delta x) \approx f(x)\,\Delta x. It may exceed 11; an area never does.
  • • F(x)=∫−∞xf(t) dtF(x) = \int_{-\infty}^{x} f(t)\,dt accumulates area from the far left: continuous, increasing, from 00 to 11, and F′=fF' = f.
  • • Improper integrals are written as LIMITS: ∫0∞=lim⁡t→∞∫0t\int_0^\infty = \lim_{t \to \infty}\int_0^t, and over the whole line the integral is split in two halves that must both converge.
0.250.50.7511.251.50.511.522.533.5f(x) = 3x²height 3strip area0.271
f(x)=3x2f(x) = 3x^2 on [0,1][0, 1] reaches the height 33 and is still a density; the shaded strip [0.9,1][0.9, 1], where the curve is highest, carries only 1−0.93=0.2711 - 0.9^3 = 0.271.

Every question of the chapter is an integral of ff with a different upper bound or a different factor: 11 for kk, bb and aa for a probability, mm for the median, a factor xx for the mean.

The two summaries: balance point and half-area cut

  • • Mean: μ=∫−∞∞xf(x) dx\mu = \int_{-\infty}^{\infty} x f(x)\,dx, the xx-coordinate of the centroid of the region under ff. It exists only if the integral CONVERGES.
  • • Median: the number mm with F(m)=12F(m) = \frac12. It always exists, and it is found by solving an equation in the upper bound.
  • • On a lopsided density they differ, and the mean lies on the side of the TAIL.
  • • Symmetric density about cc: median cc, and mean cc once the mean is known to exist.
  • • Exponential with mean μ\mu: F(t)=1−e−t/μF(t) = 1 - e^{-t/\mu}, median μln⁡2<μ\mu\ln 2 < \mu, and P(T>μ)=e−1P(T > \mu) = e^{-1}.

The mistakes that cost marks

These are the errors I correct most often in session. Each one costs marks on a paper, even when the reasoning behind it is right.

1. Reading a probability off the height of the density

the whole question, since the density is then rejected

What not to write

“f(1)=3f(1) = 3, so P(X=1)=3P(X = 1) = 3 and ff is not a density.”

What to write

“P(X=1)=∫11f(x) dx=0P(X = 1) = \int_1^1 f(x)\,dx = 0. f=3x2f = 3x^2 is a density: f≥0f \ge 0 and ∫013x2 dx=1\int_0^1 3x^2\,dx = 1.”

Why: A height is a rate. Only an area is a probability, and the figure of the essentials shows a curve three units tall whose strip near the top holds 0.2710.271.

2. Inverting the normalization constant

every probability of the exercise, all wrong by the factor 16/9

What not to write

“∫02x(2−x) dx=43\int_0^2 x(2 - x)\,dx = \frac43, so k=43k = \frac43.”

What to write

“k⋅43=1k \cdot \frac43 = 1, so k=34k = \frac34.”

Why: kk must scale the area DOWN to 11: it is the reciprocal of the area. Check in one line that kk times the area is 11.

3. Checking the total area and forgetting the sign

2 marks

What not to write

“∫−13x dx=1\int_{-1}^{\sqrt3} x\,dx = 1, so g(x)=xg(x) = x is a density on [−1,3][-1, \sqrt3].”

What to write

“g(x)<0g(x) < 0 on [−1,0)[-1, 0), so gg is NOT a density, although its signed area is 11.”

Why: An integral counts area below the axis as negative, and it can cancel. Used as a density, gg would give P(−1≤X≤0)=−12P(-1 \le X \le 0) = -\frac12.

4. Restarting the cumulative distribution function on each piece

2 to 3 marks, and every probability read from F afterwards

What not to write

“For 1≤x≤21 \le x \le 2: F(x)=∫1x(2−t) dt=2x−x22−32F(x) = \int_1^x (2 - t)\,dt = 2x - \frac{x^2}{2} - \frac32.”

What to write

“F(x)=F(1)+∫1x(2−t) dt=12+2x−x22−32=2x−x22−1F(x) = F(1) + \int_1^x (2 - t)\,dt = \frac12 + 2x - \frac{x^2}{2} - \frac32 = 2x - \frac{x^2}{2} - 1.”

Why: FF is the area from −∞-\infty, not from the start of the current piece. Two tests catch the slip: FF must be continuous at the joint, and it must reach 11 at the end.

5. Taking the middle of the interval for the median

2 marks

What not to write

“f(x)=2xf(x) = 2x on [0,1][0, 1], so the median is 12\frac12.”

What to write

“F(x)=x2F(x) = x^2 and F(m)=12F(m) = \frac12, so m=22m = \frac{\sqrt2}{2}.”

Why: The median cuts the AREA in half, not the interval. The midpoint is right only when the density is symmetric about it.

6. Confusing the mean and the median of an exponential

1 to 2 marks

What not to write

“The mean wait is 44 minutes, so half of the customers wait more than 44 minutes.”

What to write

“P(T>4)=e−1≈0.37P(T > 4) = e^{-1} \approx 0.37. The time half of them exceed is the median 4ln⁡2≈2.84\ln 2 \approx 2.8 minutes.”

246810120.050.10.150.20.250.3medianmeanarea 1/2long right tailt
For f(t)=14e−t/4f(t) = \frac14 e^{-t/4}, the shaded half of the area ends at the median 4ln⁡2≈2.84\ln 2 \approx 2.8; the balance point, the mean, sits further right at 44.

Why: The long right tail pulls the balance point past the half-area cut. On an exponential, about 6363 percent of the values fall below the mean.

7. Giving a mean by symmetry when it does not exist

the whole question

What not to write

“1π(1+x2)\frac{1}{\pi(1 + x^2)} is symmetric about 00, so its mean is 00.”

What to write

“∫0txπ(1+x2) dx=12πln⁡(1+t2)→∞\int_0^t \frac{x}{\pi(1 + x^2)}\,dx = \frac{1}{2\pi}\ln(1 + t^2) \to \infty: the mean does not exist.”

0−44normalCauchy
Both curves are symmetric about 00; the Cauchy tails stay far above the normal ones, heavy enough for ∫xf\int x f to diverge. Symmetry gives the mean of the normal only.

Why: ∫−∞∞\int_{-\infty}^{\infty} exists only if BOTH halves converge; the symmetric limit ∫−tt→0\int_{-t}^{t} \to 0 is not the definition. For the normal density each half is ±σ2π\pm\frac{\sigma}{\sqrt{2\pi}}, finite, so there the symmetry argument is valid.

8. Forgetting one of the two tails of a normal density

1 to 2 marks

What not to write

“P(400≤X≤600)=pP(400 \le X \le 600) = p, so P(X≥600)=1−pP(X \ge 600) = 1 - p.”

What to write

“The complement of the central strip is TWO tails, equal by symmetry: P(X≥600)=1−p2P(X \ge 600) = \frac{1 - p}{2}.”

Why: With μ=500\mu = 500 and σ=100\sigma = 100 the strip is symmetric about the mean. No table and no primitive are needed, only the symmetry f(μ+h)=f(μ−h)f(\mu + h) = f(\mu - h).

9. Plugging infinity into a bracket

1 method mark per integral

What not to write

“∫0∞14e−t/4 dt=[−e−t/4]0∞=−e−∞+1=1\int_0^\infty \frac14 e^{-t/4}\,dt = \left[-e^{-t/4}\right]_0^\infty = -e^{-\infty} + 1 = 1.”

What to write

“∫0s14e−t/4 dt=1−e−s/4\int_0^s \frac14 e^{-t/4}\,dt = 1 - e^{-s/4}, and lim⁡s→∞(1−e−s/4)=1\lim_{s \to \infty}\left(1 - e^{-s/4}\right) = 1.”

Why: An improper integral IS a limit, and a limit like lim⁡s e−s/4\lim s\,e^{-s/4} in the mean needs L'Hôpital's rule, which the bracket with ∞\infty hides.

Which method to choose

Which integral answers the question

Read what is asked, then write the integral before computing anything

123456780.20.40.60.811.2y = 8/(x + 2)³
f(x)=8(x+2)3f(x) = \frac{8}{(x + 2)^3} on [0,∞)[0, \infty): the curve starts at height 11 and thins out to the right, so expect a mean well to the right of the median.
  • If the density contains an unknown constant kk → solve ∫−∞∞f=1\int_{-\infty}^{\infty} f = 1 first, and check the sign condition

    Example: kx(2−x)kx(2 - x) on [0,2][0, 2]: k=34k = \frac34

  • If a probability P(a≤X≤b)P(a \le X \le b) or a tail P(X>b)P(X > b) → ∫abf\int_a^b f, or F(b)−F(a)F(b) - F(a) once FF is known; a tail is 1−F(b)1 - F(b)

    Example: 14e−t/4\frac14 e^{-t/4}: P(T>8)=e−2P(T > 8) = e^{-2}

  • If the median is asked → find FF, then solve F(m)=12F(m) = \frac12 for the upper bound

    Example: F(y)=1−y−3F(y) = 1 - y^{-3}: m=23m = \sqrt[3]{2}

  • If the mean is asked → write ∫xf(x) dx\int x f(x)\,dx and prove it CONVERGES; by parts for te−t/μt e^{-t/\mu}

    Example: 2x3\frac{2}{x^3} on [1,∞)[1, \infty): μ=2\mu = 2; 1x2\frac{1}{x^2}: no mean

  • If the density is symmetric about c → median cc; each half has area 12\frac12; mean cc only after convergence

    Example: normal with μ=500\mu = 500: P(X≤500)=12P(X \le 500) = \frac12

  • If the density is piecewise → split every integral at the joints and carry the area already accumulated into FF

    Example: F(t)=12+∫2tfF(t) = \frac12 + \int_2^t f for t≥2t \ge 2

If an integral gives a negative probability, a probability above 11, or a mean outside the interval where ff lives, the error is upstream: in kk, in a bound, or in a piece of FF.

How the answer is expected to be written

A marker ticks steps. Here they are in order, with the concluding sentence expected word for word.

Normalizing a density and computing a probability

When to use it: Any question that gives ff up to a constant, or asks you to show that ff is a density, then asks for a probability

  1. 1 State the sign condition and check it on the whole domain: f(x)≥0f(x) \ge 0, including the sign of kk.
  2. 2 Write the total area as an integral over the domain, as a LIMIT if the domain is infinite, split at the joints if ff is piecewise.
  3. 3 Compute it with an antiderivative checked by differentiation, set it equal to 11, solve for kk.
  4. 4 For the probability, write the integral with its bounds, or F(b)−F(a)F(b) - F(a), and give the exact value.
  5. 5 Sanity check: the result lies in [0,1][0, 1], and a decimal from e≈2.72e \approx 2.72 or ln⁡2≈0.69\ln 2 \approx 0.69 makes sense on the figure.

Concluding sentence

“f≥0f \ge 0 on [0,∞)[0, \infty) and lim⁡t→∞∫0tf(x) dx=1\lim_{t \to \infty}\int_0^t f(x)\,dx = 1, so ff is a probability density function, and P(X>1)=lim⁡t→∞∫1tf(x) dx=14P(X > 1) = \lim_{t \to \infty}\int_1^t f(x)\,dx = \frac14.”

The trap: Writing only the area condition. A function with signed area 11 and a negative part is not a density, and the sign line is a mark of its own.

Marking: Typically 1 mark for the sign, 1 for the integral written as a limit, 1 for the value of k, and the probability is then an application worth the rest.

Check before you hand in

Five minutes of checking recover more marks than one more problem started in a hurry.

The typical problem, taken apart

From k to the mean, on a density with an infinite domain

Let f(x)=k(x+2)3f(x) = \frac{k}{(x + 2)^3} for x≥0x \ge 0 and f(x)=0f(x) = 0 for x<0x < 0. Find kk, the cumulative distribution function, P(X>2)P(X > 2), the median and the mean.

No calculator. Every improper integral is written as a limit, as on a MATH 141 final.

Step 1

∫0t(x+2)−3 dx=[−12(x+2)2]0t=18−12(t+2)2→18\int_0^t (x + 2)^{-3}\,dx = \left[-\frac{1}{2(x + 2)^2}\right]_0^t = \frac18 - \frac{1}{2(t + 2)^2} \to \frac18, so k8=1\frac{k}{8} = 1 and k=8k = 8; the sign condition holds since k>0k > 0.

Why

Normalization comes first because every later number carries the factor kk. The antiderivative is checked by differentiating: ddx[−12(x+2)−2]=(x+2)−3\frac{d}{dx}\left[-\frac12 (x + 2)^{-2}\right] = (x + 2)^{-3}.

Step 2

F(x)=∫0x8(t+2)3 dt=8(18−12(x+2)2)=1−4(x+2)2F(x) = \int_0^x \frac{8}{(t + 2)^3}\,dt = 8\left(\frac18 - \frac{1}{2(x + 2)^2}\right) = 1 - \frac{4}{(x + 2)^2} for x≥0x \ge 0, and F(x)=0F(x) = 0 for x<0x < 0.

Why

With FF in hand, every probability becomes an evaluation. Checks: F(0)=1−44=0F(0) = 1 - \frac44 = 0 and F(x)→1F(x) \to 1.

Step 3

P(X>2)=1−F(2)=416=14P(X > 2) = 1 - F(2) = \frac{4}{16} = \frac14. Median: 1−4(m+2)2=121 - \frac{4}{(m + 2)^2} = \frac12, so (m+2)2=8(m + 2)^2 = 8 and m=22−2m = 2\sqrt2 - 2.

Why

The median is an equation in the upper bound; the positive root is kept since m≥0m \ge 0. Since F(2)=34>12F(2) = \frac34 > \frac12, the median must be below 22, and 22−2≈0.832\sqrt2 - 2 \approx 0.83 is.

Step 4

μ=lim⁡t→∞∫0t8x(x+2)3 dx\mu = \lim_{t \to \infty}\int_0^t \frac{8x}{(x + 2)^3}\,dx. With u=x+2u = x + 2: 8∫2t+2(u−2−2u−3)du→8(12−14)=28\int_2^{t + 2}\left(u^{-2} - 2u^{-3}\right)du \to 8\left(\frac12 - \frac14\right) = 2.

Why

The substitution splits the fraction into two pp-integrals with p=2p = 2 and p=3p = 3, both convergent on [2,∞)[2, \infty): the mean EXISTS, which must be said before its value.

Step 5

Compare: m=22−2≈0.83<μ=2m = 2\sqrt2 - 2 \approx 0.83 < \mu = 2, and μ=2\mu = 2 lies in [0,∞)[0, \infty).

Why

The long right tail visible on the figure pulls the mean far above the median: the order agrees with the shape, which is the last check of the answer.

The conclusion, written out

“k=8k = 8, F(x)=1−4(x+2)2F(x) = 1 - \frac{4}{(x + 2)^2} for x≥0x \ge 0, P(X>2)=14P(X > 2) = \frac14, median 22−22\sqrt2 - 2, mean 22.”

The classic mistake on this problem: Taking k=18k = \frac18, the area itself; writing F(x)=−4(x+2)2F(x) = -\frac{4}{(x + 2)^2} without the constant that makes F(0)=0F(0) = 0; or computing the mean as ∫0∞8(x+2)2 dx\int_0^\infty \frac{8}{(x + 2)^2}\,dx after dropping the factor xx.

Learn by heart

  • • Density: f≥0f \ge 0 AND total area 11. P(a≤X≤b)=∫abfP(a \le X \le b) = \int_a^b f. P(X=a)=0P(X = a) = 0.
  • • k=1areak = \frac{1}{\text{area}}, never the area itself.
  • • F(x)=∫−∞xfF(x) = \int_{-\infty}^x f: carried across the pieces, continuous, from 00 to 11, F′=fF' = f.
  • • Median: F(m)=12F(m) = \frac12. Mean: ∫xf\int x f, after proving it converges.
  • • Exponential with mean μ\mu: F(t)=1−e−t/μF(t) = 1 - e^{-t/\mu}, median μln⁡2\mu\ln 2, P(T>s+t∣T>s)=P(T>t)P(T > s + t \mid T > s) = P(T > t).
  • • Normal: symmetric about μ\mu, inflection at μ±σ\mu \pm \sigma, no primitive: use symmetry and u=x−μσu = \frac{x - \mu}{\sigma}.
  • • cxp\frac{c}{x^p} on [1,∞)[1, \infty): density iff p>1p > 1 (c=p−1c = p - 1), finite mean iff p>2p > 2.
  • • The mean lies on the side of the tail.

Frequently asked questions

Can a probability density function be greater than 1?

Yes. The value of a density is a probability per unit length, not a probability, so it can be any non-negative number. The function three x squared on the interval from 0 to 1 reaches 3 and is still a density, because the area under it is 1. What can never exceed 1 is an area under the density, and the probability of a single point is always zero.

How do I find the constant k in a probability density function?

Write the integral of the density over its whole domain, as a limit if the domain is infinite, set it equal to 1 and solve for k. The constant is the reciprocal of the area of the function without k, not the area itself. Then check that k makes the function non-negative everywhere, since that is the second condition of a density.

What is the difference between the mean and the median of a density?

The median is the point that cuts the area under the density into two halves of one half each. The mean is the balance point, the integral of x times the density, which weighs values by how far they are. On a density with a long tail, the mean is pulled towards the tail: for an exponential waiting time, the median is the mean times ln 2, about 69 percent of it.

Why is the mean of a symmetric density not always its centre?

Because the mean may not exist. The integral of x times the density over the whole line exists only if both halves converge separately. For the Cauchy density, one over pi times one plus x squared, each half is infinite, so there is no mean at all even though the curve is symmetric about 0. For the normal density both halves are finite, and there symmetry gives the mean.

Practise it

Corrected exercises: Probability density functions, MATH 141 at McGill

A method is proved on a paper, not on a sheet. The set for the same chapter takes each of these traps into a problem, with the solution written out step by step.

  • 10 corrected exercises
  • 100 points
  • 150 minutes
Do the exercises
Previous sheet Moments, centroids and hydrostatic force Next sheet Sequences

See also

Looking for a MATH 141 tutor in Montreal?

Get in touch for a first session. Probability densities are where the improper integrals of the course meet real questions about waiting times and lifetimes.

Site by Studio Squalli