# Average Value of a Function: Formula, Meaning and Examples

> Learn the average value of a function formula, why it works, how it links to the Mean Value Theorem for integrals, and worked examples step by step.

Source: https://practicecalculus.com/blog/average-value-of-a-function
Updated: 2026-11-30

## Key takeaways

- The average value of $f$ on $[a,b]$ is $f_{\text{avg}} = \frac{1}{b-a}\int_a^b f(x)\,dx$: total accumulation divided by the length of the interval.
- Geometrically, $f_{\text{avg}}$ is the height of the rectangle over $[a,b]$ that has the same area as the region under the curve.
- The Mean Value Theorem for integrals guarantees that a continuous $f$ actually equals its average value at some point $c$ in $[a,b]$.
- The average value is not the average of the endpoint values $\frac{f(a)+f(b)}{2}$, and it is not the average rate of change.

Averaging five test scores is easy: add them up and divide by five. But how do you average a temperature that changes every second, or a velocity that never sits still? There are infinitely many values, so you cannot list them. The **average value of a function** solves exactly this problem, and it turns out to be one short formula built on the definite integral.

This guide explains what the average value means, where the formula comes from, how to find the point where the function equals its average, and walks through worked examples one step at a time.

## What is the average value of a function?

The **average value** of a function $f$ on an interval $[a,b]$ is the single constant height that would produce the same total as $f$ over that interval. If you flattened the graph into a level line without changing the area underneath, the height of that line is the average value.

The formula is:

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

Read it as a two-step recipe:

1. **Integrate** $f$ from $a$ to $b$. This is the total accumulation (signed area).
2. **Divide** by $b - a$, the length of the interval.

It is the continuous version of the familiar rule: total divided by how many.

## Where does the average value formula come from?

Start with something you already know. Pick $n$ equally spaced sample points $x_1, x_2, \ldots, x_n$ in $[a,b]$ and average the function values:

$$\frac{f(x_1) + f(x_2) + \cdots + f(x_n)}{n}$$

The spacing between sample points is $\Delta x = \frac{b-a}{n}$, which means $\frac{1}{n} = \frac{\Delta x}{b-a}$. Substitute that in:

$$\frac{1}{n}\sum_{i=1}^{n} f(x_i) = \frac{1}{b-a}\sum_{i=1}^{n} f(x_i)\,\Delta x$$

The sum on the right is a [Riemann sum](/blog/riemann-sums). As you take more and more samples, $n \to \infty$, it becomes the definite integral:

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

So the average value really is an ordinary average, taken over infinitely many evenly spread sample points.

## The rectangle picture

Multiply both sides of the formula by $b-a$:

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

The left side is the area of a rectangle with width $b-a$ and height $f_{\text{avg}}$. The right side is the area under the curve. So the average value is the height of the rectangle that has **exactly the same area** as the region under the graph. The parts of the curve that poke above the rectangle balance the gaps below it.

```graph
title: 'Average value of y = x² on [0, 3] shown as a rectangle of height 3'
caption: 'The area under $y = x^2$ on $[0,3]$ is 9, the same as a rectangle of width 3 and height 3. The curve crosses its average at $c = \sqrt{3}$.'
x: [-0.5, 3.5]
y: [-1, 10]
functions:
  - expr: x^2
    label: y = x²
  - expr: '3'
    domain: [0, 3]
    label: average value y = 3
    dashed: true
points:
  - [1.732, 3, 'c = √3']
shade: {expr: x^2, from: 0, to: 3}
vertical:
  - {x: 3, label: 'x = 3'}
```

## Worked example 1: a polynomial

Find the average value of $f(x) = x^2$ on $[0, 3]$.

**Step 1. Identify $a$, $b$ and the length.** Here $a = 0$, $b = 3$, so $b - a = 3$.

**Step 2. Integrate.** Using the [reverse power rule](/rules/reverse-power-rule):

$$\int_0^3 x^2\,dx = \left[\frac{x^3}{3}\right]_0^3 = \frac{27}{3} - 0 = 9$$

**Step 3. Divide by the length.**

$$f_{\text{avg}} = \frac{1}{3}\cdot 9 = 3$$

The average value is $3$. Notice that this is not the average of the endpoint values, which would be $\frac{0 + 9}{2} = 4.5$. The curve spends most of the interval low and only shoots up near the end, so its true average is smaller.

**Step 4 (often asked). Find where $f$ equals its average.** Solve $c^2 = 3$ with $c$ in $[0,3]$: $c = \sqrt{3} \approx 1.732$. That is the point marked on the graph above.

## Worked example 2: the average value of sin x

Find the average value of $f(x) = \sin x$ on $[0, \pi]$, and find every $c$ where $f(c)$ equals that average.

**Step 1. Length.** $b - a = \pi - 0 = \pi$.

**Step 2. Integrate.** The [antiderivative of sin x](/integrals/sin-x) is $-\cos x$:

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

**Step 3. Divide.**

$$f_{\text{avg}} = \frac{2}{\pi} \approx 0.637$$

**Step 4. Solve $\sin c = \frac{2}{\pi}$.** One solution is $c = \arcsin\left(\frac{2}{\pi}\right) \approx 0.690$. Because sine is symmetric about $x = \frac{\pi}{2}$ on this interval, the second solution is $c = \pi - 0.690 \approx 2.451$. Both lie in $[0,\pi]$, so both count.

```graph
title: 'Average value of sin x on [0, π] is 2/π'
caption: 'The dashed line at height $\frac{2}{\pi} \approx 0.637$ encloses the same area as one arch of $\sin x$. The curve meets it twice.'
x: [-0.3, 3.5]
y: [-0.3, 1.3]
functions:
  - expr: sin(x)
    label: y = sin x
  - expr: '0.6366'
    domain: [0, 3.1416]
    label: y = 2/π
    dashed: true
points:
  - [0.690, 0.6366, 'c ≈ 0.690']
  - [2.451, 0.6366, 'c ≈ 2.451']
shade: {expr: sin(x), from: 0, to: 3.1416}
```

## Worked example 3: 1/x and a logarithm

Find the average value of $f(x) = \frac{1}{x}$ on $[1, e]$.

**Step 1. Length.** $b - a = e - 1$.

**Step 2. Integrate.**

$$\int_1^{e}\frac{1}{x}\,dx = \Big[\ln x\Big]_1^{e} = \ln e - \ln 1 = 1 - 0 = 1$$

**Step 3. Divide.**

$$f_{\text{avg}} = \frac{1}{e-1} \approx 0.582$$

**Step 4. Find $c$.** Solve $\frac{1}{c} = \frac{1}{e-1}$, which gives $c = e - 1 \approx 1.718$. That is inside $[1, e] \approx [1, 2.718]$, as it must be.

## Worked example 4: an average temperature

On a spring day the temperature, in degrees Fahrenheit, is modeled by

$$T(t) = 50 + 14\sin\left(\frac{\pi t}{12}\right)$$

where $t$ is hours after 6 a.m. Find the average temperature from 6 a.m. to 6 p.m., that is, on $[0, 12]$.

**Step 1. Set up.**

$$T_{\text{avg}} = \frac{1}{12}\int_0^{12}\left(50 + 14\sin\frac{\pi t}{12}\right)dt$$

**Step 2. Integrate the constant.** $\int_0^{12} 50\,dt = 600$.

**Step 3. Integrate the sine term** with [u-substitution](/blog/u-substitution). Let $u = \frac{\pi t}{12}$, so $dt = \frac{12}{\pi}\,du$, and the limits become $u = 0$ to $u = \pi$:

$$\int_0^{12} 14\sin\frac{\pi t}{12}\,dt = 14\cdot\frac{12}{\pi}\int_0^{\pi}\sin u\,du = \frac{168}{\pi}\cdot 2 = \frac{336}{\pi}$$

**Step 4. Divide by 12.**

$$T_{\text{avg}} = \frac{1}{12}\left(600 + \frac{336}{\pi}\right) = 50 + \frac{28}{\pi} \approx 58.9^\circ\text{F}$$

The temperature peaks at 64 degrees at noon, but the daytime average is just under 59 degrees.

## Worked example 5: an average of zero

A particle moves with velocity $v(t) = t^2 - 4t$ meters per second. Find its average velocity on $[0, 6]$.

$$\int_0^6 (t^2 - 4t)\,dt = \left[\frac{t^3}{3} - 2t^2\right]_0^6 = 72 - 72 = 0$$

So $v_{\text{avg}} = \frac{1}{6}\cdot 0 = 0$ meters per second. The particle moves backward for $0 < t < 4$ (where $v < 0$) and forward afterward, and the two signed areas cancel. It ends exactly where it started. This is the [net change theorem](/blog/net-change-theorem) in action: average velocity equals displacement divided by elapsed time. Average value can be zero or negative because the integral measures signed area.

## The Mean Value Theorem for integrals

In every example above, we found a point $c$ where the function equals its average. That is not luck. The [Mean Value Theorem for integrals](/theorems/mean-value-theorem-for-integrals) guarantees it:

> If $f$ is continuous on $[a,b]$, then there is at least one number $c$ in $[a,b]$ such that
> $$f(c) = \frac{1}{b-a}\int_a^b f(x)\,dx$$

The reason is short. A continuous function on a closed interval has a minimum $m$ and a maximum $M$. The average must lie between them, since you cannot average numbers and get something bigger than all of them. By the [Intermediate Value Theorem](/theorems/intermediate-value-theorem), $f$ takes every value between $m$ and $M$, so it takes the average value too.

Continuity matters. A step function that jumps from 0 to 2 at the midpoint of $[0, 2]$ has average value 1, but it never equals 1 anywhere.

## Average value vs average rate of change

These two sound alike and are mixed up constantly. Here is the clean distinction:

- **Average value of $f$:** $\frac{1}{b-a}\int_a^b f(x)\,dx$. A typical height. Uses an integral.
- **Average rate of change of $f$:** $\frac{f(b) - f(a)}{b-a}$. A secant slope. Uses only two points.

They connect through the [Fundamental Theorem of Calculus](/blog/fundamental-theorem-of-calculus). The average value of $f'$ is

$$\frac{1}{b-a}\int_a^b f'(x)\,dx = \frac{f(b) - f(a)}{b-a}$$

which is the average rate of change of $f$. That is why the integral version of the theorem and the derivative [Mean Value Theorem](/blog/mean-value-theorem) are really the same idea seen from two sides.

> **Tip:** if a question asks for an average of a rate (like average velocity) and gives you the position function, you can skip the integral and just compute $\frac{s(b) - s(a)}{b-a}$.

## Common mistakes with average value

1. **Forgetting to divide.** Reporting $\int_a^b f(x)\,dx$ as the answer. The integral is the total, not the average. In example 1 that would give 9 instead of 3.
2. **Dividing by the wrong number.** Dividing by 2, by $b$, or by the number of endpoints. Always divide by the length $b - a$.
3. **Averaging the endpoints.** $\frac{f(a) + f(b)}{2}$ only works for linear functions. For $x^2$ on $[0,3]$ it gives 4.5, which is wrong.
4. **Using the average rate of change formula.** $\frac{f(b)-f(a)}{b-a}$ answers a different question about $f$.
5. **Losing the sign.** Treating the integral as total geometric area when part of the graph is below the axis. Average value uses signed area.
6. **Keeping a $c$ outside the interval.** When solving $f(c) = f_{\text{avg}}$, reject solutions not in $[a,b]$ and keep every solution that is.

## Quick reference

| Function | Interval | Integral | Average value |
| --- | --- | --- | --- |
| $x$ | $[0, b]$ | $\frac{b^2}{2}$ | $\frac{b}{2}$ |
| $x^2$ | $[0, 3]$ | $9$ | $3$ |
| $\sin x$ | $[0, \pi]$ | $2$ | $\frac{2}{\pi}$ |
| $\sin x$ | $[0, 2\pi]$ | $0$ | $0$ |
| $\frac{1}{x}$ | $[1, e]$ | $1$ | $\frac{1}{e-1}$ |
| $e^x$ | $[0, 1]$ | $e - 1$ | $e - 1$ |
| $\lvert x \rvert$ | $[-1, 1]$ | $1$ | $\frac{1}{2}$ |

| Quantity | Formula |
| --- | --- |
| Average value of $f$ | $\frac{1}{b-a}\int_a^b f(x)\,dx$ |
| Point where $f$ equals its average | solve $f(c) = f_{\text{avg}}$ for $c$ in $[a,b]$ |
| Average rate of change of $f$ | $\frac{f(b)-f(a)}{b-a}$ |
| Average velocity | $\frac{1}{b-a}\int_a^b v(t)\,dt = \frac{s(b)-s(a)}{b-a}$ |

## Practice until the formula is automatic

The average value formula is short, which is exactly why it is easy to drop a step under exam pressure: forgetting the $\frac{1}{b-a}$, averaging endpoints, or missing a second value of $c$. A few rounds of practice fix that for good. Work through the interactive lesson below, where every problem checks your answer instantly and shows exactly which step went wrong, so the pattern of integrate, divide, then solve for $c$ becomes second nature.

## Frequently asked questions

### What is the formula for the average value of a function?

For a function $f$ that is continuous on $[a,b]$, the average value is $f_{\text{avg}} = \frac{1}{b-a}\int_a^b f(x)\,dx$. You integrate the function over the interval, then divide by the length of the interval.

### Why do you divide by b minus a?

The integral adds up the function across the whole interval, so it grows as the interval gets longer. Dividing by the length $b-a$ turns that total into a per-unit amount, exactly like dividing a sum by the number of values when you average a list of numbers.

### What is the difference between average value and average rate of change?

Average value is $\frac{1}{b-a}\int_a^b f(x)\,dx$, the typical height of $f$. Average rate of change is $\frac{f(b)-f(a)}{b-a}$, the slope of the secant line. They are connected: the average value of $f'$ equals the average rate of change of $f$.

### Can the average value of a function be negative or zero?

Yes. The integral measures signed area, so regions below the x-axis count as negative. If the function spends more area below the axis than above, the average value is negative, and if the areas balance, it is zero.

### What does the Mean Value Theorem for integrals say?

If $f$ is continuous on $[a,b]$, there is at least one number $c$ in $[a,b]$ with $f(c) = \frac{1}{b-a}\int_a^b f(x)\,dx$. In words, a continuous function hits its average value somewhere on the interval.
