# The Definite Integral and Area

Computer Science I · Calculus · https://tryals.app/learn/computer-science-i/the-definite-integral-and-area

## Accumulating Under a Curve

The **definite integral** measures the **accumulated area** between the curve $y = f(x)$ and the $x$-axis from $x = a$ to $x = b$. While derivatives measure instantaneous rates, integrals measure **totals**, like total distance traveled from a velocity curve.

Formally, it is the limit of **Riemann sums**: 

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

Here, $\Delta x$ is the width of $n$ rectangles, $f(x_i)$ is their height, and $\int$ is an elongated "S" for sum.

| Feature | Definite Integral | Indefinite Integral |
| --- | --- | --- |
| **Result** | A single **number** | A family of functions |
| **Constant** | No $+C$ | Includes $+C$ |
| **Area** | **Signed area** (net) | Total antiderivative |

## Signed Area and Pitfalls

The definite integral calculates **signed area**. Where $f(x)$ sits below the $x$-axis, its contribution is **negative**. A symmetric wave above and below the axis can integrate to zero, despite enclosing real physical area.

| Mistake | Reality | Correction |
| --- | --- | --- |
| **Positive Area** | Integrals are **signed** | Below-axis regions subtract |
| **Function Result** | It evaluates to a **number** | Do not add $+C$ |

**Common pitfall:** Confusing definite and indefinite integrals. If you need total geometric area of a wave crossing the axis, split the integral at the roots and take absolute values: $\int |f(x)|\, dx$.

## Practice questions

5 of this lesson's 10 practice questions, with answers. The full set is in the app.

### 1. Numerical integration approximates an integral by summing values at sample points. Why does a computer use these methods routinely, when the Fundamental Theorem offers an exact route?

A. Because computers cannot evaluate antiderivatives even when they are known.
B. Because numerical integration is more accurate than evaluating an antiderivative.
C. Because the Fundamental Theorem applies only to continuous functions, which are rare.
D. Because most functions have no antiderivative in elementary form.

**Answer:** D. Because most functions have no antiderivative in elementary form.

**Why:** The Fundamental Theorem is exact and conditional: it needs an antiderivative, and most integrands have none in elementary form, e^(−x²) being both the standard case and central to statistics. The commoner situation is that there is no formula at all, only sensor readings or simulation output. So quadrature is the general method and the theorem the lucky special case.

Page: https://tryals.app/practice/computer-science-i/the-definite-integral-and-area/numerical-integration-approximates-an-integral-by-summing-values-at

### 2. Select every statement that is TRUE of the DEFINITE integral of f from a to b.

A. It always equals the total geometric area enclosed
B. It is defined as a limit of sums of rectangle areas
C. It is a single number
D. It requires a constant of integration
E. Regions below the x-axis contribute negatively

**Answer:** B. It is defined as a limit of sums of rectangle areas; C. It is a single number; E. Regions below the x-axis contribute negatively

**Why:** A definite integral is one number, built as a limit of Riemann sums, and it is signed. No constant appears because there is no family of functions, and the signed total can be smaller than the geometric area whenever part of the curve dips below the axis.

Page: https://tryals.app/practice/computer-science-i/the-definite-integral-and-area/select-every-statement-that-is-true-of-the-definite-integral-of-f

### 3. A model fits its training data almost perfectly and performs poorly on new data. Which fitting concept describes this, and what is the geometric picture?

A. Overfitting, the model passes through the noise as well as the signal
B. Ill-conditioning, since small data changes produce large coefficient changes
C. Underfitting, since the model has failed to generalise
D. Truncation error, from stopping the fitting process too early

**Answer:** A. Overfitting, the model passes through the noise as well as the signal

**Why:** The model fitted the noise as faithfully as the signal, and noise does not repeat in new data. It is the interpolation-versus-fitting distinction under another name, which is why held-out validation exists, and why a model flexible enough to fit anything has told you nothing by fitting your data.

Page: https://tryals.app/practice/computer-science-i/the-definite-integral-and-area/a-model-fits-its-training-data-almost-perfectly-and-performs-poorly

### 4. Complete the formula for the strip width in a Riemann sum.

**Answer:** Slicing the interval from a to b into n strips of equal width gives each strip a width of **(b - a) divided by n**.

**Why:** The interval length b - a is divided among n strips. Only this form shrinks as n grows, which is exactly what makes the limit of the sums converge on the exact area.

Page: https://tryals.app/practice/computer-science-i/the-definite-integral-and-area/complete-the-formula-for-the-strip-width-in-a-riemann-sum

### 5. A curve is integrated from left to right. Sort each portion by how it contributes to the definite integral.

**Answer:**

- Adds a positive amount: A stretch where the curve sits above the axis
- Subtracts: A stretch where the curve dips below the axis, A deep trough well below the axis
- Contributes nothing: A stretch where the curve lies exactly on the axis

**Why:** The sign of f decides the sign of every rectangle in the sum, so dips below the axis subtract. This is why an odd function integrated over a symmetric interval returns zero even though it plainly encloses area.

Page: https://tryals.app/practice/computer-science-i/the-definite-integral-and-area/a-curve-is-integrated-from-left-to-right-sort-each-portion-by-how-it
