# What is the average value of f(x)?

Finds the average value of a function, f_ave = (1/(b − a)) ∫ f(x) dx from a to b, exactly when it can.

- Page: https://www.acalculator.org/math/average-value-of-a-function-calculator
- JSON spec: https://www.acalculator.org/math/average-value-of-a-function-calculator.json
- Version: 65a1f10325a7

## Default answer

Example with the default inputs (Function f(x) x + 1, From x = a 0, To x = b 5): The average value of x + 1 from 0 to 5 is 3.5.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| f | Function f(x) | The function of x. |
| a | From x = a | The left end: a number or a constant such as pi. |
| b | To x = b | The right end, more than a. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| average | Average value | The integral of f from a to b, divided by b − a. |
| exact | Exact average | The average value, exactly. |
| integral | ∫ f(x) dx from a to b | The definite integral. |

## Method

f_ave = (1/(b − a)) ∫ₐᵇ f(x) dx, the integral from a computer algebra system, checked numerically.

## Assumptions

- f is integrable on [a, b]; angles in radians.
- An answer that fails its check is not shown.

## Worked examples

1. f = x + 1, a = 0, b = 5 gives average = 3.5, exact = 7/2, integral = 17.5. Source: OpenStax, Calculus Volume 1, section 5.2 The Definite Integral, Example 5.14 (https://openstax.org/books/calculus-volume-1/pages/5-2-the-definite-integral): ∫₀⁵ (x + 1) dx = 35/2, average 7/2.
2. f = sin(x), a = 0, b = pi gives average = 0.63662, exact = 2/π, integral = 2.
3. f = 6 - 2x, a = 0, b = 3 gives average = 3, exact = 3, integral = 9.

## FAQ

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

The height of the rectangle on [a, b] that has the same area as the region under f: f_ave = (1/(b − a)) ∫ₐᵇ f(x) dx. It is the limit of the ordinary average of f at n equally spaced points as n grows.

### How do I find the average value of a function?

Integrate f from a to b, then divide by the length b − a. For f(x) = x + 1 on [0, 5]: ∫₀⁵ (x + 1) dx = 35/2, and 35/2 ÷ 5 = 7/2.

### Can the average value be negative?

Yes. Area below the x-axis counts as negative in the integral, so a function that is mostly negative on [a, b] has a negative average. The average of sin x on [0, 2π] is 0.

### What is the mean value theorem for integrals?

If f is continuous on [a, b], there is at least one c in [a, b] with f(c) = f_ave. The graph of f crosses the height of its average somewhere on the interval.

### Is the average value the same as the average rate of change?

No. The average rate of change is (f(b) − f(a))/(b − a), the slope of a secant line. The average value is the average height of f. The average value of f′ on [a, b] is the average rate of change of f.

### Can I use pi in the limits?

Yes. Type a and b as numbers or constants such as pi/2 or 2pi. The exact answer then keeps π: the average of sin x on [0, π] is 2/π.

### How is the answer checked?

The definite integral comes from a computer algebra system and is checked against a numeric integral. When the algebra finds no exact value, the page still shows the checked decimal.

## Sources

- OpenStax, Calculus Volume 1, section 5.2 The Definite Integral (retrieved 2026-10-03): https://openstax.org/books/calculus-volume-1/pages/5-2-the-definite-integral
