Topic · Calculus

Integrals

If the derivative measures how fast something changes, the integral measures how much has accumulated. It's the area under a curve, the total distance from a velocity, the net charge from a current — and, miraculously, it's also the exact inverse of differentiation.

What you'll leave with

  • Two ways to read the same symbol: integration as area under a curve and as the antiderivative of a function.
  • The Riemann sum — how summing thin rectangles becomes the definite integral $\int_a^b f(x)\,dx$ in the limit.
  • The difference between a definite integral (a number) and an indefinite integral (a family of functions $F(x) + C$).
  • A short table of antiderivatives you should recognize on sight, and the four properties that let you take any definite integral apart.

1. The big idea: continuous accumulation

Suppose you're driving and your speedometer reads $60$ km/h, steady, for two hours. How far have you gone? You don't need calculus — it's $60 \times 2 = 120$ km. Speed times time equals distance, and on a graph of speed versus time, that product is the area of a rectangle two hours wide and sixty km/h tall.

Now suppose your speed isn't constant. It rises, falls, dips into traffic, sprints on the highway. The picture is no longer a rectangle but a wiggly curve over the time axis. The total distance traveled is still "speed times time" — but you have to add up infinitely many infinitesimal slices, each of width $dt$ and height $v(t)$. That sum is an integral:

$$ \text{distance} = \int_{t_0}^{t_1} v(t)\,dt $$

This is the first interpretation: an integral is the continuous version of a sum. Whenever a quantity accumulates — distance from velocity, work from force, charge from current, probability from density — the operation is integration.

The second interpretation comes from running differentiation in reverse. If $v(t)$ is the derivative of position $s(t)$, then recovering $s$ from $v$ is the inverse problem. That inverse operation is also called integration, and the symbol $\int$ is shared. The Fundamental Theorem of Calculus — the next topic — is the statement that these two interpretations are the same thing.

Two pictures, one operation

Hold both interpretations at once. "Area under a curve" gives you geometric intuition: you can see the integral. "Inverse of differentiation" gives you computational power: you can compute the integral by remembering which functions differentiate to which. You need both — geometry for understanding, antiderivatives for getting the number out.

2. The Riemann sum

Pin down "area under a curve" by approximating it with shapes you already know how to measure: rectangles. Take a continuous function $f$ on the interval $[a, b]$. Chop $[a, b]$ into $n$ pieces of equal width

$$ \Delta x = \frac{b - a}{n} $$

On each piece, build a rectangle whose height is the value of $f$ at some sample point in that piece — say $x_i^*$. The rectangle's area is $f(x_i^*)\,\Delta x$. Summing all $n$ of them gives a Riemann sum:

$$ S_n = \sum_{i=1}^{n} f(x_i^*)\,\Delta x $$

You have a choice about which $x_i^*$ to use. Three standard picks:

  • Left sum. Take $x_i^* = x_{i-1}$, the left endpoint of each subinterval. Tends to under-approximate when $f$ is increasing, over-approximate when decreasing.
  • Right sum. Take $x_i^* = x_i$, the right endpoint. Errs the other way.
  • Midpoint sum. Take $x_i^* = \tfrac{1}{2}(x_{i-1} + x_i)$, the center. Over- and under-estimates inside each strip largely cancel, so the midpoint rule converges noticeably faster.

All three converge to the same limit as $n \to \infty$, so the choice doesn't matter for the integral's value — only for how quickly the approximation gets there.

The picture below shows this for $f(x) = -\tfrac{1}{8}x^2 + 2$ on $[-3, 3]$, with $n = 12$ rectangles using midpoint sampling. The rectangles aren't the area — they're an approximation to it. Some stick out above the curve, some leave gaps below; in total they slightly miss the true area.

Δx y = f(x) a b −5 5 1 2 3 x y

Now make the rectangles thinner. With $n = 100$, the gaps shrink; with $n = 10{,}000$, they're invisible. Take $n \to \infty$ and the approximation becomes exact:

$$ \int_a^b f(x)\,dx \;=\; \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x $$

The integral sign $\int$ is a stretched-out "S" for "sum"; the $dx$ is the limit of $\Delta x$ as it shrinks to zero. The notation is literally a frozen photograph of the limit process.

3. The definite integral

Definite integral

For a continuous function $f$ on $[a, b]$, the definite integral of $f$ from $a$ to $b$ is

$$ \int_a^b f(x)\,dx \;=\; \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x, $$

where $\Delta x = (b - a)/n$ and $x_i^*$ is any sample point in the $i$-th subinterval. When this limit exists, $f$ is said to be integrable on $[a, b]$.

A few things to notice. The result is a number, not a function — $\int_0^1 x^2\,dx$ evaluates to $\tfrac{1}{3}$, full stop. The letter $x$ inside is a dummy variable; you could rename it to $t$ or $u$ and get the same number. The limits $a$ and $b$ are what specify which segment of the function you care about.

Geometrically, $\int_a^b f(x)\,dx$ is the net signed area between the curve $y = f(x)$ and the x-axis on $[a, b]$. "Net signed" because area below the x-axis counts as negative:

$$ \int_0^{2\pi} \sin x \, dx \;=\; 0 $$

The first hump of $\sin x$ (from $0$ to $\pi$) lies above the axis and contributes $+2$; the second hump (from $\pi$ to $2\pi$) lies below and contributes $-2$. They cancel.

Anatomy of the symbol

$\displaystyle\int_a^b f(x)\,dx$ has four pieces: the integral sign $\int$ ("sum these up"), the lower limit $a$ and upper limit $b$ ("from here to there"), the integrand $f(x)$ ("the height at $x$"), and the differential $dx$ ("an infinitesimal width"). Together they read: add up $f(x)$ times $dx$ as $x$ runs from $a$ to $b$.

4. Indefinite integrals (antiderivatives)

Now switch interpretations. Forget area for a moment. Ask instead: given a function $f$, can I find a function $F$ whose derivative is $f$?

Antiderivative

A function $F$ is an antiderivative of $f$ on an interval $I$ if $F'(x) = f(x)$ for every $x$ in $I$.

For example, $F(x) = \tfrac{1}{3}x^3$ is an antiderivative of $f(x) = x^2$, because differentiating $\tfrac{1}{3}x^3$ gives $x^2$. But so is $\tfrac{1}{3}x^3 + 5$. And $\tfrac{1}{3}x^3 - 17$. And $\tfrac{1}{3}x^3 + C$ for any constant $C$, because the derivative of a constant is zero — the constant is invisible to differentiation.

So antiderivatives come in families, all differing by a constant. The general antiderivative of $f$ is written

$$ \int f(x)\,dx \;=\; F(x) + C $$

and called the indefinite integral of $f$. The "$+C$" — the constant of integration — is a stand-in for the entire family of vertical shifts of $F$ that all share the same derivative.

Two integrals, one symbol

Both $\int_a^b f(x)\,dx$ and $\int f(x)\,dx$ use the same integral sign, but they are different objects. The first (with limits) is a number. The second (without limits) is a family of functions. Confusing the two — especially writing "$+C$" on a definite integral — is one of the most common mistakes in early calculus.

5. Basic antiderivatives

Every differentiation rule, run backwards, becomes an antidifferentiation rule. The handful below covers most of what you'll encounter early on — memorize them, or at least be able to derive each one by differentiating the right-hand side.

IntegralResultWhy (differentiate the right-hand side)
$\displaystyle\int x^n\,dx$$\dfrac{x^{n+1}}{n+1} + C \;\;(n \neq -1)$$\tfrac{d}{dx}\bigl[\tfrac{x^{n+1}}{n+1}\bigr] = x^n$
$\displaystyle\int \tfrac{1}{x}\,dx$$\ln|x| + C$$\tfrac{d}{dx}\bigl[\ln|x|\bigr] = \tfrac{1}{x}$
$\displaystyle\int e^x\,dx$$e^x + C$$\tfrac{d}{dx}[e^x] = e^x$
$\displaystyle\int \cos x\,dx$$\sin x + C$$\tfrac{d}{dx}[\sin x] = \cos x$
$\displaystyle\int \sin x\,dx$$-\cos x + C$$\tfrac{d}{dx}[-\cos x] = \sin x$

The first row — the power rule for integration — handles every polynomial and a great many rational and root expressions. It fails at exactly one place: $n = -1$. There, $\tfrac{x^{n+1}}{n+1} = \tfrac{x^0}{0}$ is undefined, and the antiderivative is not a power at all — it's the logarithm $\ln|x|$.

The check is free

Doubtful about an antiderivative you just wrote down? Differentiate it. If you get back the original integrand, you're right. Differentiation is mechanical; integration is creative. The check goes the easy direction.

6. Properties of definite integrals

Four properties let you cut, paste, and combine integrals without ever computing them from a Riemann sum.

Linearity

Constants pull out, sums split apart:

$$ \int_a^b \bigl[\,c\,f(x) + g(x)\bigr]\,dx \;=\; c\int_a^b f(x)\,dx \;+\; \int_a^b g(x)\,dx $$

This is what makes integration of polynomials a term-by-term affair: integrate each piece, scale by its coefficient, add up.

Splitting at an interior point

If $c$ is anywhere between $a$ and $b$ (or anywhere at all, really, as long as $f$ is integrable across):

$$ \int_a^b f(x)\,dx \;=\; \int_a^c f(x)\,dx \;+\; \int_c^b f(x)\,dx $$

Geometrically: the area from $a$ to $b$ equals the area from $a$ to $c$ plus the area from $c$ to $b$. Use this to break up integrals where $f$ changes character — for example, where it crosses the x-axis.

Reversing the limits flips the sign

$$ \int_b^a f(x)\,dx \;=\; -\int_a^b f(x)\,dx $$

Integrating "backwards" reverses every $\Delta x$ in the Riemann sum, which negates the total. This is what makes $\int_a^b + \int_b^a = 0$ work out cleanly.

An integral over a single point is zero

$$ \int_a^a f(x)\,dx \;=\; 0 $$

No width, no area. A direct consequence of the previous property: $\int_a^a = -\int_a^a$, so it must be zero.

Average value of a function

For a constant function with value $c$ on $[a, b]$, the "average" is obviously $c$ — and the integral gives $c(b-a)$. Rearranging:

$$ f_{\text{avg}} \;=\; \frac{1}{b - a}\int_a^b f(x)\,dx $$

That same formula extends to any integrable $f$: divide the accumulated total by the width of the interval, and you get the height of the rectangle of width $b - a$ with the same area. Geometrically, $f_{\text{avg}}$ is the level at which a horizontal line would enclose the same signed area as the curve. For example, the average value of $\sin x$ on $[0, \pi]$ is $\tfrac{1}{\pi}\int_0^\pi \sin x\,dx = \tfrac{2}{\pi} \approx 0.637$.

7. Playground: Riemann sums

Pick a function, pick a rule, and slide $n$ upward. Watch the rectangles tile the region under the curve more and more finely — and the Riemann sum march toward the exact integral. The error shrinks roughly like $1/n$ for the left/right rules and like $1/n^2$ for the midpoint rule; you can feel that difference by sliding.

n 4
Riemann sum
Exact integral
Error
Function
Rule
4
Try it

Lock the function to $\sin(x)$ on $[0,\pi]$ and flip between Left, Right, and Midpoint at $n = 4$. The left and right sums are off by similar amounts in opposite directions; the midpoint sum is dramatically closer. Now crank $n$ to 50 — all three converge, but midpoint gets there fastest.

8. Common pitfalls

Forgetting the $+C$

An indefinite integral always carries a constant of integration. $\int 2x\,dx = x^2$ is incomplete; $\int 2x\,dx = x^2 + C$ is the answer. The $C$ matters: in differential equations, in physics setups with initial conditions, it's the constant that pins down which specific antiderivative the problem actually wants.

Treating negative areas as "wrong"

$\int_a^b f(x)\,dx$ is signed: regions below the x-axis contribute negatively. If you want geometric area regardless of sign — total ink under the curve — you need $\int_a^b |f(x)|\,dx$, which is a different problem and usually requires splitting at the zeros of $f$. The definite integral itself can be zero (or negative) even when $f$ is nonzero throughout.

Applying the power rule to $\int x^{-1}\,dx$

The power rule $\int x^n\,dx = \tfrac{x^{n+1}}{n+1} + C$ has an explicit exclusion: $n \neq -1$. At $n = -1$ the formula divides by zero. The antiderivative of $1/x$ is $\ln|x| + C$, never $\tfrac{x^0}{0}$. Always check $n$ before reaching for the power rule.

Writing $+C$ on a definite integral

$\int_0^1 x^2\,dx = \tfrac{1}{3}$. Not $\tfrac{1}{3} + C$. When you have limits, you evaluate $F(b) - F(a)$, and any constant cancels with itself. A "$+C$" floating next to a definite-integral answer is a sign the writer hasn't separated the two meanings of $\int$.

9. Worked examples

Try each one yourself before opening the solution. As always, the goal isn't the final number — it's that your sequence of moves matches the canonical one.

Example 1 · Compute $\displaystyle\int x^2\,dx$

Step 1. Apply the power rule with $n = 2$:

$$ \int x^2\,dx \;=\; \frac{x^{2+1}}{2+1} + C \;=\; \frac{x^3}{3} + C $$

Check. Differentiate: $\tfrac{d}{dx}\bigl[\tfrac{x^3}{3} + C\bigr] = \tfrac{3x^2}{3} = x^2$ ✓

Example 2 · Compute $\displaystyle\int_0^1 x^2\,dx$

Step 1. Find an antiderivative: $F(x) = \tfrac{x^3}{3}$. (No $+C$ — it cancels in the next step.)

Step 2. Evaluate $F(b) - F(a)$:

$$ \int_0^1 x^2\,dx \;=\; F(1) - F(0) \;=\; \frac{1^3}{3} - \frac{0^3}{3} \;=\; \frac{1}{3} $$

The signed area under the parabola from $0$ to $1$ is exactly $\tfrac{1}{3}$.

Example 3 · Compute $\displaystyle\int (3x^2 + 2x)\,dx$

Step 1. Use linearity — integrate term by term:

$$ \int (3x^2 + 2x)\,dx \;=\; 3\int x^2\,dx \;+\; 2\int x\,dx $$

Step 2. Apply the power rule to each piece:

$$ = 3 \cdot \frac{x^3}{3} \;+\; 2 \cdot \frac{x^2}{2} \;+\; C \;=\; x^3 + x^2 + C $$

Check. Differentiate: $\tfrac{d}{dx}[x^3 + x^2 + C] = 3x^2 + 2x$ ✓ Only one constant of integration is needed — the two would just combine.

Example 4 · Compute $\displaystyle\int \sin x\,dx$

Step 1. Recall $\tfrac{d}{dx}[\cos x] = -\sin x$. To get a derivative of $+\sin x$, negate:

$$ \frac{d}{dx}[-\cos x] \;=\; -(-\sin x) \;=\; \sin x $$

Step 2. Write the antiderivative:

$$ \int \sin x\,dx \;=\; -\cos x + C $$

The minus sign is the easy thing to drop — be deliberate about it.

Example 5 · Compute $\displaystyle\int_0^{\pi} \sin x\,dx$

Step 1. Antiderivative: $F(x) = -\cos x$.

Step 2. Evaluate $F(\pi) - F(0)$:

$$ \int_0^{\pi} \sin x\,dx \;=\; \bigl[-\cos x\bigr]_0^{\pi} \;=\; -\cos\pi \,-\, (-\cos 0) \;=\; -(-1) - (-1) \;=\; 2 $$

The area of one full hump of $\sin x$ above the x-axis is exactly $2$ — a tidy fact worth remembering. Contrast with $\int_0^{2\pi}\sin x\,dx = 0$: the second hump (below the axis) contributes $-2$ and cancels the first.

Sources & further reading

The treatment above is synthesized from standard calculus references. Reach for these when you want a fuller exposition, more practice problems, or a different angle on the same idea.

Test your understanding

A quiz that builds from easy to hard. Pick an answer to get instant feedback and a worked explanation. Your progress is saved in this browser — come back anytime to continue.

Question 1 of 24
0 correct