Beginner

Average Value of a Function Calculator

Compute the average (mean) value of a chosen function over an interval [a, b] using the mean value of integrals.

Function f(x)

Pick the function to average
Average value of f on [a, b]
5.3333

Mean height of the curve over the interval

Definite integral
21.3333
Interval width (b − a)
4
Interval
[0, 4]
f(x) on the interval
Average value line
Step by step
  1. 1

    Interval width

    b − a = 4 − 0 = 4
  2. 2

    Definite integral ∫f(x)dx

    21.333333
    Computed numerically with the composite Simpson rule (1,000 subintervals).
  3. 3

    Average value = integral ÷ (b − a)

    21.333333 ÷ 4 = 5.3333
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

The average value of a function on [a, b] equals the definite integral of f(x) from a to b divided by the width b − a. Choose a function and the endpoints, and this tool integrates with the Simpson rule (n = 1000) and returns the mean height, plotting the curve against its average line.

Formula
f_avg = (1 / (b − a)) · ∫[a→b] f(x) dx
How this is calculated

Select a function f(x) and enter the interval endpoints a and b. The average value of a continuous function over [a, b] is defined as f_avg = (1/(b − a)) · ∫ from a to b of f(x) dx — the constant height of a rectangle on [a, b] that has the same area under it as the curve.

The definite integral is evaluated numerically with the composite Simpson rule using n = 1000 subintervals, which fits parabolas to pairs of subintervals and is highly accurate for smooth functions. The result is then divided by the interval width (b − a). If a > b the bounds are swapped automatically, and identical endpoints (a = b) are rejected because the width would be zero.

All angle-based functions (sin, cos) use radians. Be careful with functions that are undefined on part of the interval — for example 1/x or √x across x = 0 can produce infinite or non-real samples, in which case the numerical integral may be unreliable. Keep the interval within the function domain for a meaningful answer.

Frequently asked questions

It is the constant value f_avg such that a rectangle of height f_avg over [a, b] has the same area as the region under f(x). By the Mean Value Theorem for integrals, a continuous f attains this value at some point in [a, b].

The integral uses the composite Simpson rule with 1000 subintervals, which gives near-exact results for smooth functions like polynomials, sine, and exponentials.

The calculator sorts the bounds, so the average is computed over the smaller-to-larger interval. The endpoints must differ, since a zero-width interval has no defined average.

Also known as

average value of a function
mean value of integral
function average calculator
integral average
average value calculus
mean value theorem integral

APA

TG we-Calculate Editorial Team. (2026). Average Value of a Function Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/average-value-of-a-function-calculator

Chicago

TG we-Calculate Editorial Team. "Average Value of a Function Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/average-value-of-a-function-calculator.

IEEE

TG we-Calculate Editorial Team, "Average Value of a Function Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/average-value-of-a-function-calculator

BibTeX

@misc{wecalculate_average_value_of_a_function_calculator, title = {Average Value of a Function Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/average-value-of-a-function-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?