mathcalculus

integrals

adding up thin slices: area, distance from speed, and how it undoes the derivative.

report a mistake
.md

cut the region under a curve into thin slices, add them up, and let the slices get thinner. the number the sums close in on is the integral. its slope, as the right end moves, is the curve itself, so one antiderivative evaluates it.

riemann sum
Σ f(xᵢ) Δx n slices, a height times a width each
definite integral
∫ₐᵇ f(x) dx what the sums close in on as n grows
signed
below the axis counts − sin x over a full turn is 0, though the area is 4
fundamental theorem
∫ₐᵇ f = F(b) − F(a) for any F with F′ = f. the running area has slope f
power rule, backwards
∫ xⁿ dx = xⁿ⁺¹/(n + 1) + C n ≠ −1. for n = −1 it's ln|x|
+ C
∫ f(x) dx = F(x) + C an antiderivative is a family. a constant has slope 0
reach for it
  • area under a curve, or between two curves
  • a total from a rate: distance from speed, charge from current
  • a game loop: position += velocity · dt is one slice a frame
on this page
  1. the idea
  2. explore
  3. try it
  4. the rules
  5. worked examples
  6. the key idea up close
  7. in code
  8. pitfalls
  9. practice

the idea

how much area is under y=x2y = x^2 between x=0x = 0 and x=1x = 1? the top edge is curved, so no formula for a triangle or a rectangle fits. cut the region into thin vertical slices instead. each slice is nearly a rectangle, and a rectangle’s area is height times width. add them up and the total is close to the area. cut thinner and it’s closer. the number the totals close in on is the integral, written ∫01x2 dx\int_0^1 x^2 \, dx: the ∫\int is a stretched s, for sum, and dxdx is the width of a slice gone to nothing.

the movie reads each slice’s height twice, at its left edge in cyan and at its right edge in amber. one set stays under the curve and the other pokes over it, so the area is trapped between the two sums.

the region under y=x2y = x^2 from 0 to 1. the top is curved, so no formula for a triangle or a rectangle fits it. cut it into slices instead.

an animation on a square plot of y = x² from x = 0 to 1. first the region under the curve is shaded and marked area?. then it is cut into slices with two rectangles on each: a cyan one as tall as the curve at the slice's left edge, which stays under the curve, and an amber one as tall as it at the right edge, which pokes over it. with 1 slice the sums are 0.0000 and 1.0000. with 2 slices, 0.1250 and 0.6250. with 4, 0.2188 and 0.4688. with 8, 0.2734 and 0.3984. with 16, 0.3027 and 0.3652. with 32, 0.3179 and 0.3491. with 64, 0.3256 and 0.3412. the gap between them is always one slice's width, 1/n, and a number line under the plot shows the two sums closing in on 1/3 ≈ 0.3333 from both sides: the integral.

the same picture answers a different question. if the curve is a speed, the area under it is the distance covered: a thin slice is a speed times a short time, which is a short distance, and the slices add up to the trip. a game loop does the same thing one frame at a time, position += velocity * dt: one slice a frame.

explore

pick a curve, a rule and nn, and drag the ends of the interval. the readout gives the sum, the exact integral, the error between them, and the area with every part counted positive. slices under the axis are amber: they count negative in the sum.

−1−0.500.511.5201234ab

drag a and b along the axis, or tab to one and use the arrow keys

from a to b
0 to 1
left sum, n = 8
0.2734
exact: F(b) − F(a), with F(x) = x³/3
0.3333
error, sum − exact
−0.0599
area, with the amber counted +
0.3333
a slice under the axis is amber and counts negative in the sum

an interactive chart with a row of buttons for six curves, x², x, x² − 1, sin x, eˣ and 1/x, a row for four rules, left, right, midpoint and trapezoid, a slider for n from 1 to 64, and two points a and b to drag along the x axis, or move with the arrow keys. the slices are drawn under the curve, cyan over the axis and amber under it, with a dot where each height is read. a readout gives the interval, the sum, the exact integral F(b) − F(a) with F named, the error, and the area with every part counted positive. it opens on x² from 0 to 1 with 8 left slices: the sum is 0.2734, the integral 0.3333, the error −0.0599.

try sin x from 0 to 2π: the sum is 0 at any n, and the area is 4. and try y = x with the trapezoid rule: exact at n = 1.

try it

y = x² from 0 to 2, cut into 2 slices, each as tall as the curve at the left edge. what do the slices add up to?

00.511.5201234

pick one.

0 / 0 right

a practice exercise with five kinds of question: add up the slices of a drawn riemann sum, pick the antiderivative of a function, evaluate a definite integral with the fundamental theorem, read a signed area off two given areas, and get a distance from a speed. it opens on y = x² from 0 to 2 in 2 left slices, which add to 1, then ∫ 3x² dx, which is x³ + C.

the rules

the riemann sum

∑i=1nf(xi∗) ΔxΔx=b−an\sum_{i=1}^{n} f(x_i^*) \, \Delta x \qquad \Delta x = \frac{b - a}{n}

cut [a,b][a, b] into nn slices of width Δx\Delta x, pick a point xi∗x_i^* in each, and add up the rectangles: height f(xi∗)f(x_i^*) times width Δx\Delta x. the left edge gives the left sum, the right edge the right sum, the middle the midpoint sum. each term is one rectangle’s area, so the sum is the area of a staircase that follows the curve.

the definite integral

∫abf(x) dx=lim⁡n→∞∑i=1nf(xi∗) Δx\int_a^b f(x) \, dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*) \, \Delta x

the number the sums close in on as the slices get thinner. for a continuous ff they do close in, and on the same number whichever point of each slice is picked. why: the lowest and the highest height in each slice give an under-estimate and an over-estimate, every other choice lands between them, and the gap between the two goes to 0, since ff barely changes across a thin slice. the movie’s cyan and amber sums are that pair for x2x^2. so the integral depends on ff, aa and bb alone. the limits page is about what closing in means.

the trapezoid rule

Tn=Ln+Rn2=Δx[12f(x0)+f(x1)+⋯+f(xn−1)+12f(xn)]\begin{aligned} T_n &= \frac{L_n + R_n}{2} \\[4pt] &= \Delta x \Big[ \tfrac{1}{2} f(x_0) + f(x_1) + \cdots \\ &\qquad + f(x_{n-1}) + \tfrac{1}{2} f(x_n) \Big] \end{aligned}

each slice is a trapezoid: its two corners on the curve are joined by a straight edge, so its area is the average of its two heights times the width, and over all the slices that’s the average of the left and right sums. every inside point is the right edge of one slice and the left edge of the next, so it counts in full. the two ends count half each.

what carries over from sums

∫ab(f+g)=∫abf+∫abg∫abc f=c∫abf∫abf=∫acf+∫cbf∫baf=−∫abf\begin{aligned} \int_a^b \big(f + g\big) &= \int_a^b f + \int_a^b g \\[4pt] \int_a^b c \, f &= c \int_a^b f \\[4pt] \int_a^b f &= \int_a^c f + \int_c^b f \\[4pt] \int_b^a f &= -\int_a^b f \end{aligned}

each one holds for every riemann sum, term by term, so it holds for the number the sums close in on. a sum of two heights splits into two sums, a constant factor comes out front, the slices of [a,b][a, b] are the slices of [a,c][a, c] and of [c,b][c, b] together, and running from bb down to aa makes every Δx\Delta x negative, which flips the sign. what doesn’t carry over is a product: ∫fg\int fg isn’t ∫f⋅∫g\int f \cdot \int g, because a sum of products isn’t a product of sums.

signed area against area

∫abf(x) dx=(area above)−(area below)\begin{aligned} \int_a^b f(x) \, dx &= (\text{area above}) \\ &\quad - (\text{area below}) \end{aligned}

the integral counts a part under the axis negative, because its heights are negative. the area between the curve and the axis counts it positive: that’s ∫ab∣f(x)∣ dx\int_a^b \lvert f(x) \rvert \, dx, which in practice means splitting the interval where ff crosses zero and flipping the sign of the negative pieces. which one you want depends on the question. a displacement, a net change, money in and out: the integral. how much paint covers the region, how far a car drove counting the way back: the area.

the fundamental theorem

A(x)=∫axf(t) dtA′(x)=f(x)\begin{gathered} A(x) = \int_a^x f(t) \, dt \\[6pt] A'(x) = f(x) \end{gathered}

the running area, from aa out to a moving right end xx, is a function of xx, and its slope is the height of the curve there. moving xx a small step hh adds a strip about f(x)f(x) tall and hh wide, so AA grows by about f(x)⋅hf(x) \cdot h: slope f(x)f(x). drag xx in the figure and watch the two plots: the slope of the lower curve is the height of the upper one. the key idea section works the argument through.

00.511.5201234xt00.511.520123x

drag x along the axis of the first plot, or tab to it and use the arrow keys

x
1
f(x), the height there
1.0000
A(x), the area so far
0.3333
the strip, A(x + h) − A(x), h = 0.25
0.3177
the strip over h
1.2708
slope of A at x
f(x) = 1.0000

two plots, with a row of buttons for f(t) = t² and f(t) = sin t and a slider for the strip width h, 0.5, 0.25, 0.1, 0.05 or 0.01. the first plot draws f in cyan with the area under it shaded from 0 to a point x that drags along the axis, or moves with the arrow keys, and a strip h wide at x drawn as a rectangle f(x) tall. the second traces A(x), the area so far, in white up to x, with a cyan tangent whose slope is f(x). a readout gives x, f(x), A(x), the strip A(x + h) − A(x), the strip over h, and the slope of A. it opens on t² at x = 1 with h = 0.25: f(1) = 1, A(1) = 0.3333, the strip 0.3177, the strip over h 1.2708. with h = 0.01 the strip over h is 1.0100.

the slope of the white curve is the cyan height: A′(x) = f(x). shrink h, and the strip over h closes in on f(x).
∫abf(x) dx=F(b)−F(a)for any F with F′=f\begin{gathered} \int_a^b f(x) \, dx = F(b) - F(a) \\[6pt] \text{for any } F \text{ with } F' = f \end{gathered}

the second half, and the one that does the work. AA and FF have the same derivative, so they differ by a constant: F(x)=A(x)+CF(x) = A(x) + C. then F(b)−F(a)=A(b)−A(a)F(b) - F(a) = A(b) - A(a), and A(a)A(a) is 0, so the difference is A(b)A(b): the integral. no slices needed. find one function whose derivative is ff and take its change across the interval. the bracket [F(x)]ab\big[F(x)\big]_a^b is shorthand for F(b)−F(a)F(b) - F(a).

antiderivatives

FF is an antiderivative of ff when F′=fF' = f, and ∫f(x) dx=F(x)+C\int f(x) \, dx = F(x) + C is the whole family of them. every line here is a rule from the derivatives page, read backwards:

∫xn dx=xn+1n+1+C∫1x dx=ln⁡∣x∣+C∫ex dx=ex+C∫sin⁡x dx=−cos⁡x+C∫cos⁡x dx=sin⁡x+C\begin{aligned} \int x^n \, dx &= \frac{x^{n+1}}{n + 1} + C \\[6pt] \int \frac{1}{x} \, dx &= \ln \lvert x \rvert + C \\[6pt] \int e^x \, dx &= e^x + C \\[6pt] \int \sin x \, dx &= -\cos x + C \\[6pt] \int \cos x \, dx &= \sin x + C \end{aligned}

the power rule backwards, for every nn but −1-1: ddxxn+1=(n+1)xn\frac{d}{dx} x^{n+1} = (n + 1) x^n, so dividing by n+1n + 1 leaves xnx^n. at n=−1n = -1 that would divide by 0, and ln⁡∣x∣\ln \lvert x \rvert fills the gap, since its derivative is 1/x1/x on both sides of 0. the +C+ C: a constant has slope 0, so F+CF + C has the same derivative as FF, and nothing else does. sums and constant factors carry over from the derivative rules too: ∫(3x2+1) dx=x3+x+C\int (3x^2 + 1) \, dx = x^3 + x + C. check any antiderivative by differentiating it.

substitution

∫f(g(x)) g′(x) dx=∫f(u) du,u=g(x)\begin{aligned} &\int f(g(x)) \, g'(x) \, dx \\[4pt] &\qquad = \int f(u) \, du, \quad u = g(x) \end{aligned}

the chain rule run backwards. ddxF(g(x))=F′(g(x)) g′(x)\frac{d}{dx} F(g(x)) = F'(g(x)) \, g'(x), so when the integrand has the shape f(g(x))⋅g′(x)f(g(x)) \cdot g'(x), an inside function times its derivative, the antiderivative is F(g(x))F(g(x)). in practice: set u=g(x)u = g(x), replace g′(x) dxg'(x) \, dx with dudu, integrate in uu, and put g(x)g(x) back. with limits, move them too: x=ax = a becomes u=g(a)u = g(a). one example:

∫2xcos⁡(x2) dx=∫cos⁡u du=sin⁡u+C=sin⁡(x2)+C\begin{aligned} \int 2x \cos(x^2) \, dx &= \int \cos u \, du \\[4pt] &= \sin u + C \\[4pt] &= \sin(x^2) + C \end{aligned}

with u=x2u = x^2 and du=2x dxdu = 2x \, dx. check: the derivative of sin⁡(x2)\sin(x^2) is cos⁡(x2)⋅2x\cos(x^2) \cdot 2x.

worked examples

the movie’s area, in one line

∫01x2 dx=[x33]01=13−0=13\int_0^1 x^2 \, dx = \Big[ \frac{x^3}{3} \Big]_0^1 = \frac{1}{3} - 0 = \frac{1}{3}

x3/3x^3/3 has derivative x2x^2, so the fundamental theorem gives the number the slices were closing in on. from 0 to 2 the same antiderivative gives 8/3≈2.678/3 \approx 2.67: eight times as much for twice the width, since the region is taller as well as wider.

distance from speed

a cart starts from rest and its speed grows as v(t)=3tv(t) = 3t m/s. how far does it go in 4 s? the distance is the area under the speed graph:

∫043t dt=[3t22]04=24 m\int_0^4 3t \, dt = \Big[ \frac{3t^2}{2} \Big]_0^4 = 24 \text{ m}

the graph is a straight line from 0 to 12 m/s, so the region is a triangle, and 12⋅4⋅12=24\tfrac{1}{2} \cdot 4 \cdot 12 = 24 agrees. the units work out too: m/s times s is m. with a starting speed, v(t)=2+3tv(t) = 2 + 3t, the integral from 0 to 4 is 2⋅4+24=322 \cdot 4 + 24 = 32 m: the rectangle under the starting speed plus the same triangle.

signed area

∫02πsin⁡x dx=[−cos⁡x]02π=−1−(−1)=0\begin{aligned} \int_0^{2\pi} \sin x \, dx &= \big[ -\cos x \big]_0^{2\pi} \\[4pt] &= -1 - (-1) = 0 \end{aligned}

the hump from 0 to π\pi has area 2 and the dip from π\pi to 2π2\pi has area 2 under the axis, and the integral cancels them. the area between the curve and the axis is 4: split at π\pi and add the two sizes. the same for x2−1x^2 - 1 from 0 to 2: the integral is [x3/3−x]02=8/3−2=2/3\big[x^3/3 - x\big]_0^2 = 8/3 - 2 = 2/3, while the area is 2, a dip of 2/32/3 below the axis from 0 to 1 and a rise of 4/34/3 above it from 1 to 2.

an antiderivative with a condition

a function has slope F′(x)=6x2−4F'(x) = 6x^2 - 4 and passes through F(1)=3F(1) = 3. integrate term by term: F(x)=2x3−4x+CF(x) = 2x^3 - 4x + C. the condition fixes CC: F(1)=2−4+C=3F(1) = 2 - 4 + C = 3, so C=5C = 5 and F(x)=2x3−4x+5F(x) = 2x^3 - 4x + 5. the +C+ C is where the known point goes in. in motion it’s the same: a velocity integrates to a position plus a constant, and the constant is where the object started.

a substitution with limits

∫012x (x2+1)3 dx\int_0^1 2x \, (x^2 + 1)^3 \, dx

u=x2+1u = x^2 + 1 and du=2x dxdu = 2x \, dx. the limits move with it: x=0x = 0 is u=1u = 1 and x=1x = 1 is u=2u = 2.

∫12u3 du=[u44]12=16−14=154\int_1^2 u^3 \, du = \Big[ \frac{u^4}{4} \Big]_1^2 = \frac{16 - 1}{4} = \frac{15}{4}

no need to go back to xx once the limits are in uu.

1/x, estimated and exact

∫141x dx=ln⁡4−ln⁡1=ln⁡4≈1.3863\int_1^4 \frac{1}{x} \, dx = \ln 4 - \ln 1 = \ln 4 \approx 1.3863. with three slices of width 1, the midpoint sum is 11.5+12.5+13.5≈1.3524\frac{1}{1.5} + \frac{1}{2.5} + \frac{1}{3.5} \approx 1.3524 and the trapezoid sum is 12⋅1+12+13+12⋅14≈1.4583\tfrac{1}{2} \cdot 1 + \tfrac{1}{2} + \tfrac{1}{3} + \tfrac{1}{2} \cdot \tfrac{1}{4} \approx 1.4583: one a little under, the other a little over. that’s how it goes for any curve that bends upward across the interval, this one and x2x^2 included: a straight edge between two points on it lies above it, so the trapezoid overshoots, and the midpoint rectangle has the same area as the tangent trapezoid at the middle, which lies below.

the key idea up close

why the running area has slope f

let A(x)=∫axf(t) dtA(x) = \int_a^x f(t) \, dt, the area from aa out to xx. move the right end a small step hh further. the area gains a thin strip:

A(x+h)−A(x)=∫xx+hf(t) dtA(x + h) - A(x) = \int_x^{x+h} f(t) \, dt

across a strip that thin, ff barely changes. it stays between its smallest and largest values on [x,x+h][x, x + h], call them mm and MM, so the strip sits between a rectangle mm tall and one MM tall, both hh wide:

m h  ≤  A(x+h)−A(x)  ≤  M hm \, h \;\le\; A(x + h) - A(x) \;\le\; M \, h

divide by hh:

m  ≤  A(x+h)−A(x)h  ≤  Mm \;\le\; \frac{A(x + h) - A(x)}{h} \;\le\; M

as h→0h \to 0 the strip shrinks onto the point xx, and ff is continuous, so both mm and MM close in on f(x)f(x). the quotient is trapped between them, so it goes to f(x)f(x) too. and the quotient is the slope of AA:

A′(x)=lim⁡h→0A(x+h)−A(x)h=f(x)\begin{aligned} A'(x) &= \lim_{h \to 0} \frac{A(x + h) - A(x)}{h} \\[4pt] &= f(x) \end{aligned}

that’s what the running area figure shows: for t2t^2 at x=1x = 1 the strip over its width reads 1.2708 with h=0.25h = 0.25, 1.1033 with h=0.1h = 0.1 and 1.0100 with h=0.01h = 0.01, against f(1)=1f(1) = 1.

the second half follows. if F′=fF' = f too, then (F−A)′=0(F - A)' = 0, and a function with slope 0 everywhere is a constant, so F=A+CF = A + C. at x=ax = a the area is 0, so C=F(a)C = F(a). at x=bx = b: A(b)=F(b)−F(a)A(b) = F(b) - F(a). a limit of sums, computed by one subtraction.

in code

riemann.py sums the slices by each rule and, run as a script, prints how the error shrinks for x2x^2 on [0,1][0, 1] as nn doubles from 4 to 128:

python/math/riemann.py
"""riemann sums: the area under a curve as n slices of equal width, each a height times the width, with the height read at the slice's left edge, its right edge or its middle, or the slice taken as a trapezoid. a slice under the axis counts negative. run as a script, it doubles n again and again for x² on [0, 1], whose exact area is 1/3, and prints how far each rule is off: the left and right errors about halve each time, the midpoint and trapezoid errors quarter."""

from __future__ import annotations

from dataclasses import dataclass
from typing import Callable

Fn = Callable[[float], float]

RULES = ("left", "right", "midpoint", "trapezoid")


def left_sum(f: Fn, a: float, b: float, n: int) -> float:
    """Return the sum of n rectangles under f on [a, b], each as tall as f at its left edge."""
    dx = (b - a) / n
    return sum(f(a + i * dx) for i in range(n)) * dx


def right_sum(f: Fn, a: float, b: float, n: int) -> float:
    """Return the sum of n rectangles under f on [a, b], each as tall as f at its right edge."""
    dx = (b - a) / n
    return sum(f(a + (i + 1) * dx) for i in range(n)) * dx


def midpoint_sum(f: Fn, a: float, b: float, n: int) -> float:
    """Return the sum of n rectangles under f on [a, b], each as tall as f at its middle."""
    dx = (b - a) / n
    return sum(f(a + (i + 0.5) * dx) for i in range(n)) * dx


def trapezoid_sum(f: Fn, a: float, b: float, n: int) -> float:
    """Return the sum of n trapezoids under f on [a, b]: the average of the left and right sums.

    Every inside point is the right edge of one slice and the left edge of the next, so it counts in full;
    the two ends count half each.
    """
    dx = (b - a) / n
    inside = sum(f(a + i * dx) for i in range(1, n))
    return (f(a) / 2 + inside + f(b) / 2) * dx


def riemann_sum(f: Fn, a: float, b: float, n: int, rule: str) -> float:
    """Return the sum by the rule named: left, right, midpoint or trapezoid."""
    sums = {"left": left_sum, "right": right_sum, "midpoint": midpoint_sum, "trapezoid": trapezoid_sum}
    if rule not in sums:
        raise ValueError(f"no rule named {rule!r}")
    return sums[rule](f, a, b, n)


@dataclass(frozen=True)
class Row:
    """One n of the error table: each rule's error, sum − exact, and its ratio to the row before."""

    n: int
    error: dict[str, float]
    ratio: dict[str, float | None]


def error_table(f: Fn, a: float, b: float, exact: float, ns: list[int]) -> list[Row]:
    """Return how each rule's error shrinks as n grows, one row per n.

    The ratio of a row's error to the row before it says how much a step in n buys: with n doubling it
    comes to about 1/2 for the left and right rules and 1/4 for midpoint and trapezoid.
    """
    rows: list[Row] = []
    for n in ns:
        error = {rule: riemann_sum(f, a, b, n, rule) - exact for rule in RULES}
        prev = rows[-1].error if rows else None
        ratio = {rule: error[rule] / prev[rule] if prev else None for rule in RULES}
        rows.append(Row(n, error, ratio))
    return rows


def format_table(rows: list[Row]) -> str:
    """Return the table as text: n, the four errors to seven places, then the four ratios to three."""
    lines = [f"{'n':>4}  " + "  ".join(f"{rule:>10}" for rule in RULES) + "   ratios"]
    for row in rows:
        errors = "  ".join(f"{row.error[rule]:>+10.7f}" for rule in RULES)
        ratios = "  ".join("    –" if row.ratio[rule] is None else f"{row.ratio[rule]:.3f}" for rule in RULES)
        lines.append(f"{row.n:>4}  {errors}   {ratios}")
    return "\n".join(lines)


if __name__ == "__main__":
    print(format_table(error_table(lambda x: x * x, 0, 1, 1 / 3, [4, 8, 16, 32, 64, 128])))

each row of the table is the four rules’ errors, the sum minus 1/31/3, and the ratio to the row above. the left and right ratios settle toward 0.5: from 64 slices to 128 the left error goes from −0.0078 to −0.0039, a ratio of 0.501. the midpoint and trapezoid ratios read 0.250 at every step: from 64 to 128 the midpoint error goes from −0.0000203 to −0.0000051. for x2x^2 the midpoint error is exactly −1/(12n2)-1/(12n^2) and the trapezoid error exactly +1/(6n2)+1/(6n^2), so doubling nn quarters both, and the trapezoid sum misses by twice as much as the midpoint sum, the other way. the pattern is general: the one-edge rules have an error that shrinks like 1/n1/n. in the midpoint and trapezoid rules, a slice’s over and under parts nearly cancel, and the error left shrinks like 1/n21/n^2.

pitfalls

practice

  1. evaluate ∫03x2 dx\int_0^3 x^2 \, dx.

    answer

    an antiderivative is x3/3x^3/3. take it at 3, minus at 0: 27/3−0=927/3 - 0 = 9.

  2. for x2x^2 on [0,2][0, 2] with 4 slices of width 0.5, work out the left, right, midpoint and trapezoid sums, and compare them with the exact value.

    answer

    left edges 0, 0.5, 1, 1.5 give heights 0, 0.25, 1, 2.25, so the left sum is (0+0.25+1+2.25)⋅0.5=1.75(0 + 0.25 + 1 + 2.25) \cdot 0.5 = 1.75. right edges give heights 0.25, 1, 2.25, 4: the right sum is 3.753.75. middles 0.25, 0.75, 1.25, 1.75 give heights 0.0625, 0.5625, 1.5625, 3.0625: the midpoint sum is 2.6252.625. the trapezoid sum is the average of left and right: 2.752.75. exact: [x3/3]02=8/3≈2.67\big[x^3/3\big]_0^2 = 8/3 \approx 2.67. the left and right sums miss by 0.92 and 1.08, the midpoint sum is under by 0.04 and the trapezoid sum over by 0.08.

  3. a cart moves at v(t)=2+3tv(t) = 2 + 3t m/s. how far does it travel from t=0t = 0 to t=4t = 4 s, and which area formula checks it?

    answer

    ∫04(2+3t) dt=[2t+3t2/2]04=8+24=32\int_0^4 (2 + 3t) \, dt = \big[2t + 3t^2/2\big]_0^4 = 8 + 24 = 32 m. the speed graph is a straight line from 2 to 14 m/s, so the region under it is a trapezoid: 12(2+14)⋅4=32\tfrac{1}{2}(2 + 14) \cdot 4 = 32.

  4. find ∫−12(x2−1) dx\int_{-1}^{2} (x^2 - 1) \, dx, and then the area between the curve and the axis over the same interval.

    answer

    [x3/3−x]−12=(8/3−2)−(−1/3+1)=2/3−2/3=0\big[x^3/3 - x\big]_{-1}^{2} = (8/3 - 2) - (-1/3 + 1) = 2/3 - 2/3 = 0. the curve is under the axis from −1-1 to 1 and over it from 1 to 2. the piece below: [x3/3−x]−11=(1/3−1)−(−1/3+1)=−4/3\big[x^3/3 - x\big]_{-1}^{1} = (1/3 - 1) - (-1/3 + 1) = -4/3, so 4/34/3 of area. the piece above: (8/3−2)−(1/3−1)=4/3(8/3 - 2) - (1/3 - 1) = 4/3. the area is 8/3≈2.678/3 \approx 2.67. the integral is 0 because the two pieces are the same size and count with opposite signs.

  5. F′(x)=6x2−4F'(x) = 6x^2 - 4 and F(1)=3F(1) = 3. find FF.

    answer

    term by term, F(x)=2x3−4x+CF(x) = 2x^3 - 4x + C. then F(1)=2−4+C=3F(1) = 2 - 4 + C = 3 gives C=5C = 5, so F(x)=2x3−4x+5F(x) = 2x^3 - 4x + 5. check: F′(x)=6x2−4F'(x) = 6x^2 - 4, and F(1)=2−4+5=3F(1) = 2 - 4 + 5 = 3.

  6. evaluate ∫012x (x2+1)3 dx\int_0^1 2x \, (x^2 + 1)^3 \, dx by substitution.

    answer

    u=x2+1u = x^2 + 1, du=2x dxdu = 2x \, dx, and the limits become u=1u = 1 to u=2u = 2. then ∫12u3 du=[u4/4]12=(16−1)/4=15/4=3.75\int_1^2 u^3 \, du = \big[u^4/4\big]_1^2 = (16 - 1)/4 = 15/4 = 3.75.