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)
Mean height of the curve over the interval
- 1
Interval width
b − a = 4 − 0 = 4 - 2
Definite integral ∫f(x)dx
21.333333Computed numerically with the composite Simpson rule (1,000 subintervals). - 3
Average value = integral ÷ (b − a)
21.333333 ÷ 4 = 5.3333
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
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
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
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.
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
@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?
