From: 3blue1brown

Integration is a common mathematical tool used to find the average of a continuous variable [00:00:19]. This application provides an insightful perspective on why integrals and derivatives are inverses of each other [00:00:29].

Finding the Average of a Continuous Function

Consider the graph of sin(x) between 0 and π, which represents half of its period [00:00:33]. A practical question could be, “What is the average height of this graph on that interval?” [00:00:40]. This is relevant for modeling cyclic phenomena, such as the average effectiveness of solar panels based on the number of daylight hours over a year [00:00:46].

The challenge with finding the average of a continuous variable lies in the infinite number of values within a given range. Unlike a finite set of numbers, where you sum them and divide by their count, you cannot sum infinitely many values and divide by infinity [00:01:48].

When faced with the desire to “add together infinitely many values associated with a continuum,” the key is almost always to use an integral [00:02:08].

Approximating the Average with Finite Sums

A helpful first step is to approximate the continuous situation with a finite sum [00:02:17]. Imagine sampling a finite number of points evenly spaced along the range from 0 to π [00:02:20]. The average of this finite sample can be found by summing the heights (sin(x) at each point) and dividing by the number of sampled points [00:02:32]. As more points are sampled, this approximation should get closer to the true average of the continuous variable [00:02:47].

This concept is related to taking an integral, where you also consider a sample of inputs on a continuum [00:03:07]. Instead of just adding heights, an integral adds “little areas,” specifically sin(x) times dx, where dx is the spacing between samples [00:03:18]. The integral is the value that this sum approaches as dx approaches 0 [00:03:31].

Deriving the Average Value Formula

To formally connect the finite average to the integral, reframe the expression for the average (sum of heights / number of sampled points) in terms of dx, the spacing between samples [00:03:50].

If the interval length is π and the spacing is dx, the number of samples is approximately π / dx [00:04:31]. Substituting this into the average formula:

Average ≈ (Sum of sin(x) values) / (π / dx) [00:04:34]

Rearranging, this becomes:

Average ≈ (Sum of (sin(x) * dx)) / π [00:04:38]

As the number of samples increases (i.e., dx approaches 0), the sum in the numerator approaches the integral of sin(x) between 0 and π [00:05:02].

Therefore, the average height of a graph over an interval is:

Average Height = (Integral of f(x) over the interval) / (Width of the interval) [00:05:11]

This means the average height is the area under the graph divided by its width [00:05:11].

Solving the Example: Average of sin(x)

To compute the integral, an antiderivative of the function (sin(x)) is needed [00:05:31]. The derivative of cos(x) is -sin(x), so the antiderivative of sin(x) is -cos(x) [00:05:45].

To evaluate the integral of sin(x) between 0 and π:

  1. Evaluate the antiderivative at the upper bound (π): -cos(π) = 1 [00:06:22].
  2. Evaluate the antiderivative at the lower bound (0): -cos(0) = -1 [00:06:22].
  3. Subtract the lower bound value from the upper bound value: 1 - (-1) = 2 [00:06:25].

This means the area under the sine graph from 0 to π is 2 [00:06:43].

The average height of sin(x) on the interval [0, π] is then: Average Height = Area / Width = 2 / π [00:06:48]

Which is approximately 0.64 [00:07:01].

Integrals and Derivatives as Inverses

This problem illustrates an important aspect of the relationship between integrals and derivatives. The process of finding the average value (2/π) involved:

  1. Looking at the change in the antiderivative (-cos(x)) over the input range [0, π] [00:07:20].
  2. Dividing by the length of that range (π) [00:07:24].

This fraction, (Change in Antiderivative) / (Change in x), is precisely the rise-over-run slope between the starting and ending points of the antiderivative graph [00:07:30].

Since sin(x) is the derivative of -cos(x), sin(x) gives the slope of the -cos(x) graph at every point [00:07:50]. Therefore, the average value of sin(x) can be thought of as the average slope over all tangent lines of the -cos(x) graph between 0 and π [00:08:03]. It makes intuitive sense that the average slope of a graph over a range should equal the total slope (rise over run) between its start and end points [00:08:08].

Generalization

For any function f(x), its average value on an interval [a, b] is given by:

Average Value = (Integral of f(x) from a to b) / (b - a) [00:08:33]

This is the signed area under the graph divided by its width [00:08:47].

The connection to finite averages is maintained:

  • A finite sample’s average is (Sum of f(x) values) / (Number of samples) [00:09:14].
  • Number of samples ≈ (b - a) / dx [00:09:08].
  • Substituting yields (Sum of (f(x) * dx)) / (b - a) [00:09:18].
  • As dx approaches 0, the sum becomes the integral [00:09:27].

Evaluating the integral requires finding an antiderivative of f(x), often denoted as F(x) [00:09:42]. The integral’s value is F(b) - F(a), which represents the change in height of the antiderivative graph between the bounds [00:09:51].

Thus, the average value is:

Average Value = (F(b) - F(a)) / (b - a) [00:10:21]

This is the slope of the antiderivative graph between the two endpoints [00:10:31]. Since f(x) is the derivative of F(x) by definition, f(x) gives the slope of the tangent line to F(x) at each point [00:10:41]. This perspective highlights why antiderivatives are crucial for solving integrals: reframing the question of finding an average as finding the average slope allows the answer to be found by comparing only the endpoints of the antiderivative graph [00:11:01].

When to Think of Integrals

Two key “sensations” should bring integrals to mind:

  1. If a problem can be approximated by breaking it into small pieces and summing them up [00:11:27].
  2. If an idea understood in a finite context (like averaging numbers) needs to be generalized to an infinite, continuous range of values [00:11:42]. In such cases, phrasing the problem in terms of an integral is often the solution [00:11:56]. This is particularly common in probability [00:12:02].