Practice / Calculus

The fundamental theorem of calculus: derivatives of integrals and definite integrals

Ten problems on both parts of the fundamental theorem: an accumulation function checked against its closed form, a chain-rule upper limit, a variable lower limit, two moving limits and the maximum they give, critical points of an integral, definite integrals with an absolute value, the derivative of a Gaussian and an exponential CDF, and a limit of an integral by L'Hôpital's rule, with worked solutions and the mistakes of a missing chain-rule factor, a lost minus sign and confusing F with f.

Before you start

The fundamental theorem is the link between the two halves of calculus: the derivative of an accumulated area is the height of the curve, and a definite integral is a difference of antiderivatives. In machine learning it is the reason a probability density is the derivative of its cumulative distribution function, so the density of any transformed variable comes from the chain rule on a CDF. The work goes wrong in a few places: a chain-rule factor left off a limit like x3x^3, the minus sign of a variable lower limit dropped, the value of the integrand at a constant lower limit subtracted, an absolute value integrated as if it were not there, and the accumulation function FF confused with its integrand ff. These ten problems cover each of them.

  • Part 1. If ff is continuous and F(x)=∫axf(t) dtF(x) = \displaystyle\int_a^x f(t)\,dt, then F′(x)=f(x)F'(x) = f(x). The constant aa does not appear in the answer.
  • Moving limits. By the chain rule, ddx∫g(x)h(x)f(t) dt=f(h(x)) h′(x)−f(g(x)) g′(x)\dfrac{d}{dx}\displaystyle\int_{g(x)}^{h(x)} f(t)\,dt = f\big(h(x)\big)\,h'(x) - f\big(g(x)\big)\,g'(x). A constant limit contributes 00; a variable lower limit contributes a minus sign.
  • Part 2. If ff is continuous on [a,b][a, b] and F′=fF' = f, then ∫abf(x) dx=F(b)−F(a)\displaystyle\int_a^b f(x)\,dx = F(b) - F(a). Any antiderivative works, so no +C+C is needed.
  • F(x)=∫axf(t) dtF(x) = \int_a^x f(t)\,dt is a function of xx, not of tt: tt is a dummy variable. FF is increasing where f>0f > 0, so its critical points are the zeros of ff.
  • A cumulative distribution function is F(x)=∫−∞xp(t) dtF(x) = \displaystyle\int_{-\infty}^x p(t)\,dt for a density pp, so F′=pF' = p. For the standard normal, Φ(z)=∫−∞zφ(t) dt\Phi(z) = \displaystyle\int_{-\infty}^z \varphi(t)\,dt with φ(t)=12πe−t2/2\varphi(t) = \dfrac{1}{\sqrt{2\pi}}e^{-t^2/2}.
  • ∣x−c∣\lvert x - c\rvert is c−xc - x for x<cx < c and x−cx - c for x>cx > c: split the integral at cc.

Builds on: Differentiation rules: chain, product, quotient

Problems

  1. ·

    Let F(x)=∫1x(t3−2t) dtF(x) = \displaystyle\int_1^x (t^3 - 2t)\,dt. Find F′(x)F'(x) by Part 1, then find F(x)F(x) in closed form and check.

  2. ··

    Find ddx∫1x3ln⁡t dt\dfrac{d}{dx}\displaystyle\int_1^{x^3} \ln t\,dt for x>0x > 0, and its value at x=2x = 2.

  3. ··

    Find ddx∫x51+t4 dt\dfrac{d}{dx}\displaystyle\int_x^5 \sqrt{1 + t^4}\,dt, and its value at x=1x = 1.

  4. ···

    Let G(x)=∫x2xe−t dtG(x) = \displaystyle\int_x^{2x} e^{-t}\,dt for x≥0x \ge 0. Find G′(x)G'(x), and the xx at which GG is largest.

  5. ··

    Let F(x)=∫0x(t2−4t+3) dtF(x) = \displaystyle\int_0^x (t^2 - 4t + 3)\,dt. Find the local maximum and minimum values of FF.

  6. ·

    Evaluate ∫14(2x+1x) dx\displaystyle\int_1^4 \Big(2x + \frac{1}{\sqrt x}\Big)\,dx.

  7. ··

    Evaluate ∫03∣x−1∣ dx\displaystyle\int_0^3 \lvert x - 1\rvert\,dx.

  8. ··

    Φ\Phi is the standard normal CDF. Find ddxΦ(2x−1)\dfrac{d}{dx}\Phi(2x - 1), and its value at x=12x = \tfrac12.

  9. ···

    The waiting time TT has density p(t)=2e−2tp(t) = 2e^{-2t} for t≥0t \ge 0. Find its CDF F(x)=P(T≤x)F(x) = P(T \le x), check that F′=pF' = p, and find the median.

  10. ···

    Find lim⁡x→01x3∫0xsin⁡(t2) dt\displaystyle\lim_{x\to0}\frac{1}{x^3}\int_0^x \sin(t^2)\,dt.

Worked solutions

Problem 1

Let F(x)=∫1x(t3−2t) dtF(x) = \displaystyle\int_1^x (t^3 - 2t)\,dt. Find F′(x)F'(x) by Part 1, then find F(x)F(x) in closed form and check.

  1. F′(x)=x3−2xF'(x) = x^3 - 2xPart 1: replace tt with the upper limit.
  2. F(x)=[t44−t2]1x=x44−x2−(14−1)F(x) = \Big[\tfrac{t^4}4 - t^2\Big]_1^x = \tfrac{x^4}4 - x^2 - \big(\tfrac14 - 1\big)Part 2 with the antiderivative t44−t2\tfrac{t^4}4 - t^2.
  3. F(x)=x44−x2+34F(x) = \tfrac{x^4}4 - x^2 + \tfrac34The lower limit only adds the constant 34\tfrac34.
  4. F′(x)=x3−2xF'(x) = x^3 - 2x, and F(x)=x44−x2+34F(x) = \tfrac{x^4}4 - x^2 + \tfrac34 has that derivativeThe constant 34\tfrac34 differentiates to 00, which is why the lower limit never appears in F′F'. Also F(1)=0F(1) = 0, as it must.

Problem 2

Find ddx∫1x3ln⁡t dt\dfrac{d}{dx}\displaystyle\int_1^{x^3} \ln t\,dt for x>0x > 0, and its value at x=2x = 2.

  1. ln⁡(x3)⋅ddxx3\ln(x^3)\cdot\dfrac{d}{dx}x^3Put the upper limit into the integrand, then multiply by its derivative.
  2. =3ln⁡x⋅3x2= 3\ln x\cdot3x^2ln⁡(x3)=3ln⁡x\ln(x^3) = 3\ln x and (x3)′=3x2(x^3)' = 3x^2.
  3. Check: ∫1x3ln⁡t dt=[tln⁡t−t]1x3=3x3ln⁡x−x3+1\displaystyle\int_1^{x^3}\ln t\,dt = \big[t\ln t - t\big]_1^{x^3} = 3x^3\ln x - x^3 + 1, whose derivative is 9x2ln⁡x+3x2−3x29x^2\ln x + 3x^2 - 3x^2The long way agrees.
  4. 9x2ln⁡x9x^2\ln x; at x=2x = 2 it is 36ln⁡2≈24.9536\ln2 \approx 24.95Without the chain-rule factor the answer would be 3ln⁡x3\ln x, off by a factor of 3x23x^2.

Problem 3

Find ddx∫x51+t4 dt\dfrac{d}{dx}\displaystyle\int_x^5 \sqrt{1 + t^4}\,dt, and its value at x=1x = 1.

  1. ∫x51+t4 dt=−∫5x1+t4 dt\displaystyle\int_x^5 \sqrt{1 + t^4}\,dt = -\int_5^x \sqrt{1 + t^4}\,dtSwapping the limits changes the sign, and puts xx in the upper limit.
  2. ddx(−∫5x1+t4 dt)=−1+x4\dfrac{d}{dx}\Big(-\displaystyle\int_5^x \sqrt{1 + t^4}\,dt\Big) = -\sqrt{1 + x^4}Part 1.
  3. −1+x4-\sqrt{1 + x^4}; at x=1x = 1 it is −2≈−1.414-\sqrt2 \approx -1.414Moving the lower limit right removes area from a positive integrand, so the derivative must be negative.

Problem 4

Let G(x)=∫x2xe−t dtG(x) = \displaystyle\int_x^{2x} e^{-t}\,dt for x≥0x \ge 0. Find G′(x)G'(x), and the xx at which GG is largest.

  1. G′(x)=e−2x⋅2−e−x⋅1G'(x) = e^{-2x}\cdot2 - e^{-x}\cdot1Upper limit 2x2x with derivative 22, minus the lower limit xx with derivative 11.
  2. G′(x)=0  ⟺  2e−2x=e−x  ⟺  e−x=12G'(x) = 0 \iff 2e^{-2x} = e^{-x} \iff e^{-x} = \tfrac12Divide by e−x>0e^{-x} > 0.
  3. x=ln⁡2x = \ln2G′>0G' > 0 for x<ln⁡2x < \ln2 and G′<0G' < 0 after, so this is the maximum.
  4. G(ln⁡2)=e−ln⁡2−e−2ln⁡2=12−14G(\ln2) = e^{-\ln2} - e^{-2\ln2} = \tfrac12 - \tfrac14G(x)=e−x−e−2xG(x) = e^{-x} - e^{-2x} by Part 2.
  5. G′(x)=2e−2x−e−xG'(x) = 2e^{-2x} - e^{-x}; GG is largest at x=ln⁡2≈0.693x = \ln2 \approx 0.693, where G=14G = \tfrac14G(0)=0G(0) = 0 and G→0G \to 0 as x→∞x \to \infty: the interval [x,2x][x, 2x] starts empty and ends where e−te^{-t} is tiny.

Problem 5

Let F(x)=∫0x(t2−4t+3) dtF(x) = \displaystyle\int_0^x (t^2 - 4t + 3)\,dt. Find the local maximum and minimum values of FF.

  1. F′(x)=x2−4x+3=(x−1)(x−3)F'(x) = x^2 - 4x + 3 = (x - 1)(x - 3)Part 1. The critical points of FF are the zeros of its integrand.
  2. F′′(x)=2x−4F''(x) = 2x - 4, so F′′(1)=−2F''(1) = -2 and F′′(3)=2F''(3) = 2Local maximum at 11, local minimum at 33.
  3. F(x)=x33−2x2+3xF(x) = \tfrac{x^3}3 - 2x^2 + 3xPart 2; the lower limit 00 adds nothing.
  4. F(1)=13−2+3=43F(1) = \tfrac13 - 2 + 3 = \tfrac43 and F(3)=9−18+9=0F(3) = 9 - 18 + 9 = 0The values of FF, not of the integrand.
  5. Local maximum 43\tfrac43 at x=1x = 1; local minimum 00 at x=3x = 3FF climbs while the integrand is positive, on (0,1)(0, 1), and loses exactly that area again on (1,3)(1, 3), where the integrand is negative.

Problem 6

Evaluate ∫14(2x+1x) dx\displaystyle\int_1^4 \Big(2x + \frac{1}{\sqrt x}\Big)\,dx.

  1. An antiderivative is x2+2xx^2 + 2\sqrt x∫x−1/2 dx=x1/21/2=2x\int x^{-1/2}\,dx = \tfrac{x^{1/2}}{1/2} = 2\sqrt x.
  2. (16+2⋅2)−(1+2⋅1)=20−3\big(16 + 2\cdot2\big) - \big(1 + 2\cdot1\big) = 20 - 3F(4)−F(1)F(4) - F(1). The integrand is continuous on [1,4][1, 4].
  3. 1717Term by term: ∫142x dx=15\int_1^4 2x\,dx = 15 and ∫14x−1/2 dx=2\int_1^4 x^{-1/2}\,dx = 2.

Problem 7

Evaluate ∫03∣x−1∣ dx\displaystyle\int_0^3 \lvert x - 1\rvert\,dx.

  1. ∣x−1∣=1−x\lvert x - 1\rvert = 1 - x on [0,1][0, 1] and x−1x - 1 on [1,3][1, 3]Split where the inside changes sign.
  2. ∫01(1−x) dx=[x−x22]01=12\displaystyle\int_0^1 (1 - x)\,dx = \Big[x - \tfrac{x^2}2\Big]_0^1 = \tfrac12The first piece.
  3. ∫13(x−1) dx=[x22−x]13=32−(−12)=2\displaystyle\int_1^3 (x - 1)\,dx = \Big[\tfrac{x^2}2 - x\Big]_1^3 = \tfrac32 - \big(-\tfrac12\big) = 2The second piece.
  4. 52\tfrac52Two triangles: one with legs 11 and 11, one with legs 22 and 22.

Problem 8

Φ\Phi is the standard normal CDF. Find ddxΦ(2x−1)\dfrac{d}{dx}\Phi(2x - 1), and its value at x=12x = \tfrac12.

  1. Φ(2x−1)=∫−∞2x−1φ(t) dt\Phi(2x - 1) = \displaystyle\int_{-\infty}^{2x - 1}\varphi(t)\,dtA CDF is an integral with a variable upper limit.
  2. ddxΦ(2x−1)=φ(2x−1)⋅2\dfrac{d}{dx}\Phi(2x - 1) = \varphi(2x - 1)\cdot2Part 1 with the chain rule; the lower limit −∞-\infty does not move.
  3. At x=12x = \tfrac12: 2φ(0)=22π2\varphi(0) = \dfrac{2}{\sqrt{2\pi}}φ(0)=12π\varphi(0) = \tfrac1{\sqrt{2\pi}}.
  4. 2φ(2x−1)2\varphi(2x - 1); at x=12x = \tfrac12 it is 2/π≈0.798\sqrt{2/\pi} \approx 0.798This is the density of X=Z+12X = \tfrac{Z + 1}2: P(X≤x)=Φ(2x−1)P(X \le x) = \Phi(2x - 1), and differentiating a CDF gives the density. It is the normal density with mean 12\tfrac12 and standard deviation 12\tfrac12.

Problem 9

The waiting time TT has density p(t)=2e−2tp(t) = 2e^{-2t} for t≥0t \ge 0. Find its CDF F(x)=P(T≤x)F(x) = P(T \le x), check that F′=pF' = p, and find the median.

  1. F(x)=∫0x2e−2t dt=[−e−2t]0xF(x) = \displaystyle\int_0^x 2e^{-2t}\,dt = \Big[-e^{-2t}\Big]_0^xThe density is 00 for t<0t < 0, so the integral starts at 00.
  2. F(x)=1−e−2xF(x) = 1 - e^{-2x} for x≥0x \ge 0−e−2x−(−1)-e^{-2x} - (-1). F(0)=0F(0) = 0 and F→1F \to 1.
  3. F′(x)=2e−2x=p(x)F'(x) = 2e^{-2x} = p(x)Part 1, confirmed by differentiating the closed form.
  4. 1−e−2m=12  ⟺  e−2m=12  ⟺  m=ln⁡221 - e^{-2m} = \tfrac12 \iff e^{-2m} = \tfrac12 \iff m = \tfrac{\ln2}2The median is where the CDF reaches 12\tfrac12.
  5. F(x)=1−e−2xF(x) = 1 - e^{-2x}; median ln⁡22≈0.347\tfrac{\ln2}2 \approx 0.347The mean is 12\tfrac12, larger than the median: the long right tail pulls it up.

Problem 10

Find lim⁡x→01x3∫0xsin⁡(t2) dt\displaystyle\lim_{x\to0}\frac{1}{x^3}\int_0^x \sin(t^2)\,dt.

  1. As x→0x \to 0 both ∫0xsin⁡(t2) dt\int_0^x \sin(t^2)\,dt and x3x^3 go to 00The form is 00\tfrac00, so L'Hôpital's rule applies.
  2. lim⁡x→0sin⁡(x2)3x2\displaystyle\lim_{x\to0}\frac{\sin(x^2)}{3x^2}Differentiate the top by Part 1 and the bottom by the power rule.
  3. sin⁡(x2)x2→1\dfrac{\sin(x^2)}{x^2} \to 1With u=x2→0u = x^2 \to 0, sin⁡uu→1\tfrac{\sin u}u \to 1.
  4. 13\tfrac13Near 00, sin⁡(t2)≈t2\sin(t^2) \approx t^2, and ∫0xt2 dt=x33\int_0^x t^2\,dt = \tfrac{x^3}3: the same answer without the rule.

Where this goes wrong

1. Leaving out the chain-rule factor

Part 1 is learned as "put the upper limit in", which is the whole rule only when the limit is xx.

  1. ddx∫1x3ln⁡t dt\dfrac{d}{dx}\displaystyle\int_1^{x^3}\ln t\,dt, x>0x > 0Right so far: Problem 2.
  2. “Replace tt with the upper limit.”The habit that causes the mistake: the limit is x3x^3, not xx, so it moves 3x23x^2 times as fast.
  3. ln⁡(x3)=3ln⁡x\ln(x^3) = 3\ln x, so at x=2x = 2 the derivative is 3ln⁡2≈2.0793\ln2 \approx 2.079The edge of the area moves at the rate (x3)′=3x2(x^3)' = 3x^2, and the derivative is 9x2ln⁡x9x^2\ln x, which is 36ln⁡2≈24.9536\ln2 \approx 24.95 at x=2x = 2, twelve times as much. Differentiating the closed form 3x3ln⁡x−x3+13x^3\ln x - x^3 + 1 shows the factor.

2. Dropping the sign of a variable lower limit

In most problems xx is the upper limit, so the minus sign is easy to forget.

  1. ddx∫x51+t4 dt\dfrac{d}{dx}\displaystyle\int_x^5 \sqrt{1 + t^4}\,dtRight so far: Problem 3.
  2. “Put xx into the integrand.”The habit that causes the mistake: Part 1 applied without first moving xx to the upper limit.
  3. The derivative is 1+x4\sqrt{1 + x^4}, so 2≈1.414\sqrt2 \approx 1.414 at x=1x = 1∫x5=−∫5x\int_x^5 = -\int_5^x, so the derivative is −1+x4-\sqrt{1 + x^4}, which is −1.414-1.414 at x=1x = 1. As xx increases, the interval [x,5][x, 5] gets shorter and the integrand is positive, so the integral is decreasing.

3. Subtracting the integrand at the lower limit

Part 2 is "top minus bottom", and the pattern carries over to Part 1, where it does not belong.

  1. F(x)=∫1x(t3−2t) dtF(x) = \displaystyle\int_1^x (t^3 - 2t)\,dtRight so far: Problem 1.
  2. “The derivative is ff at the top minus ff at the bottom.”The habit that causes the mistake: Part 2's subtraction copied into Part 1.
  3. F′(x)=(x3−2x)−(1−2)=x3−2x+1F'(x) = (x^3 - 2x) - (1 - 2) = x^3 - 2x + 1The lower limit is a constant, and it contributes a constant, 34\tfrac34, to FF, which differentiates to 00. F′(x)=x3−2xF'(x) = x^3 - 2x; at x=2x = 2 that is 44, not 55. Only a lower limit that moves with xx contributes to the derivative.

4. Integrating an absolute value without splitting

The bars look like decoration once the integral is set up.

  1. ∫03∣x−1∣ dx\displaystyle\int_0^3 \lvert x - 1\rvert\,dxRight so far: Problem 7.
  2. “For most of the interval x−1≥0x - 1 \ge 0, so use x−1x - 1.”The habit that causes the mistake: one formula used on both sides of x=1x = 1.
  3. ∫03(x−1) dx=92−3=32\displaystyle\int_0^3 (x - 1)\,dx = \tfrac92 - 3 = \tfrac32On [0,1][0, 1], x−1x - 1 is negative, so the triangle there, of area 12\tfrac12, is subtracted instead of added. Split at x=1x = 1: 12+2=52\tfrac12 + 2 = \tfrac52. The integral of a function that is never negative is a total area, and here 32=2−12\tfrac32 = 2 - \tfrac12 is a net one.

5. Reporting the integrand's value instead of F's

FF and its integrand share the same critical points, which makes it easy to evaluate the wrong one.

  1. F(x)=∫0x(t2−4t+3) dtF(x) = \displaystyle\int_0^x (t^2 - 4t + 3)\,dt, local maximum at x=1x = 1Right so far: Problem 5, step 2.
  2. “Plug x=1x = 1 into the function.”The habit that causes the mistake: the function on the page is the integrand.
  3. The local maximum value is 1−4+3=01 - 4 + 3 = 000 is the integrand at x=1x = 1: it is F′(1)F'(1), which is 00 at every critical point. The value of FF is the area accumulated up to 11, F(1)=13−2+3=43F(1) = \tfrac13 - 2 + 3 = \tfrac43. The local minimum value is F(3)=0F(3) = 0, which happens to be 00 for a different reason.

Print this set: fundamental-theorem-of-calculus.pdf (problems, answers, and worked solutions on separate pages).

Read the guide: The fundamental theorem of calculus: derivatives of integrals, and the chain rule on the limit