Average Value of a Function Calculator - With Steps

Supports + − * / ^, parentheses, and sin, cos, tan, ln, sqrt, abs, exp, pi, e. Trig works in radians.

Try an example

Average value of f(x) = x^2 on [0, 3]

3

f_avg = 1/(b − a) · ∫ f(x) dx = 9 / 3

∫ f(x) dx

9

Interval width b − a

3

Minimum of f on [a, b]

0

Maximum of f on [a, b]

9

Mean Value Theorem for integrals

The function actually reaches its average: f(c) = 3 at c ≈ 1.732051. The green dot on the graph marks it.

Leveling the curve: two regions, one area

a = 0b = 3avg ≈ 3
area under f(x) rectangle at average height (same area) f_avg

Step-by-Step Solution

  1. Formula: f_avg = 1/(b − a) · ∫[a, b] f(x) dx
  2. Interval width: b − a = 3 − 0 = 3
  3. Antiderivative: F(x) = (1/3)x^3
  4. Evaluate at the bounds: F(3) = 9 and F(0) = 0
  5. ∫ f(x) dx = F(b) − F(a) = 9 − 0 = 9
  6. Divide by the width: f_avg = 9 / 3 = 3
  7. Mean Value Theorem for integrals: f(c) = f_avg at c ≈ 1.732051

How to Use This Calculator

  1. Type your function into the "Function f(x)" field — powers use ^, so x squared is x^2, and trig arguments are in radians.
  2. Set "Lower bound a" and "Upper bound b". Both accept pi and e, so a full sine arch is simply 0 to pi.
  3. Read the average value in the green panel; the line beneath it shows the integral divided by the interval width.
  4. Check the graph: the blue region (area under the curve) and the green rectangle (average height × width) always enclose the same area.
  5. Use the c value in the Mean Value Theorem card to see exactly where f(x) equals its own average — the green dot on the dashed line.

Share this calculator

Help others solve their calculations

Found this calculator helpful? Share it with your friends, students, or colleagues who might need it!

Average Value of a Function Calculator: How to Compute the Mean With One Integral

About the Author

Marko Šinko - Co-Founder & Lead Developer

Marko Šinko

Co-Founder & Lead Developer, AI Math Calculator

Lepoglava, Croatia
Advanced Algorithm Expert

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Co-founder of award-winning projects, ensuring precise mathematical computations and reliable calculator tools.

📅 Published:Updated:
Average value of a function calculator graph showing a curve over an interval with the mean height line and equal shaded areas.

Point an average value of a function calculator at f(x) = x² on the interval [0, 3] and it returns exactly 3 — not 4.5, which is what you get by averaging the two endpoint heights f(0) = 0 and f(3) = 9. The gap between those answers is the whole subject of this page. A function's true average has to weigh every value it passes through, and between 0 and 3 there are infinitely many of them, most of them small: x² stays below 3 until x reaches √3 ≈ 1.73, more than halfway across the interval. Only an integral can average infinitely many values. The calculator above runs that integral for you and reports the mean value, the definite integral itself, the minimum and maximum of f, and the exact point c where the function equals its own average. Below: where the formula 1/(b − a)·∫ f(x) dx comes from, three complete worked solutions, and the difference between average value and average rate of change — the mix-up that costs the most exam points.

Why You Can't Just Average the Endpoints

Averaging a list of numbers is easy: add them up, divide by the count. A function on an interval breaks both halves of that recipe — there's no finite list and no count. The natural fix is sampling. Take x² on [0, 3] at the four points x = 0, 1, 2, 3 and you get (0 + 1 + 4 + 9)/4 = 3.5. Sample at seven points and the estimate drops to about 3.25. Sample at a thousand and you're at 3.0045. The estimates are marching somewhere, and that somewhere is 3.

What you're actually computing with each refinement is a Riemann sum divided by the interval width — the same construction a Riemann sum calculator uses to approximate area. In the limit, the sample average (1/n)·Σ f(xᵢ) becomes 1/(b − a) · ∫ f(x) dx. That's not a formula somebody decreed; it's literally what "add them all and divide by how many" turns into when "all" means a continuum. The endpoint average (0 + 9)/2 = 4.5 fails because it samples exactly two points and ignores how long the function lingers at low values — and x² lingers low for most of [0, 3].

One Integral, Divided by the Width

f_avg = 1/(b − a) · ∫[a, b] f(x) dx

The integral measures the signed area between the curve and the x-axis; dividing by b − a converts that area into a height. The geometric reading is worth keeping in your head: f_avg is the height of the one rectangle over [a, b] whose area exactly matches the area under the curve. Imagine the region under f(x) filled with water, then let it settle flat — the waterline lands precisely at the average value. Peaks pour into valleys until nothing moves.

One warning hides in the word "signed." Area below the x-axis counts as negative, so sin(x) averaged over [0, 2π] gives exactly 0 — the positive arch and the negative arch cancel. That's not a bug. If f(t) is a velocity, an average of 0 means you ended up where you started, which is precisely the physical truth. When you want the average size regardless of sign, average |f(x)| instead: for sin(x) on [0, 2π] that's 4/(2π) ≈ 0.6366.

Using the Average Value of a Function Calculator on x², sin(x), and 1/x

Run 1 — the polynomial. f(x) = x² on [0, 3]. The antiderivative is F(x) = x³/3, so the integral is F(3) − F(0) = 9 − 0 = 9. Width: 3 − 0 = 3. Average: 9/3 = 3. If the antiderivative step is the part that slows you down, a dedicated antiderivative calculator shows that piece in isolation.

Run 2 — the sine arch. f(x) = sin(x) on [0, π]. Integral: ∫ sin(x) dx = −cos(x), so −cos(π) − (−cos(0)) = 1 + 1 = 2. Width: π. Average: 2/π ≈ 0.6366. Most people guess 0.5 here, reasoning that sine runs from 0 up to 1 and back. But sine is not a straight ramp — it's concave on this interval and loiters near its peak. Between x = π/4 and x = 3π/4, half the interval, sin(x) never drops below 0.707. The average has to reflect that, and 0.6366 does.

Run 3 — the reciprocal. f(x) = 1/x on [1, 4]. Integral: ln(4) − ln(1) = ln 4 ≈ 1.3863. Width: 3. Average: ln(4)/3 ≈ 0.4621. Compare the endpoint average (1 + 0.25)/2 = 0.625 — a 35% overestimate, because 1/x plunges early and spends most of the interval below 0.5. The Mean Value Theorem point lands at c = 1/0.4621 ≈ 2.164, comfortably inside [1, 4]. You can verify any of these integrals independently with the definite integral calculator.

A few averages come up often enough to be worth recognizing on sight:

FunctionIntervalAverage value
xⁿ[0, 1]1/(n + 1)
sin(x)[0, π]2/π ≈ 0.6366
sin²(x)[0, 2π]1/2 exactly
[0, 1]e − 1 ≈ 1.7183
1/x[1, e]1/(e − 1) ≈ 0.5820

Average Value vs. Average Rate of Change

Calculus has two "averages" and exams love to swap them. The average value of f answers "how high is this function, typically?" The average rate of change answers "how steep is it, overall?" — it's the slope of the secant line, (f(b) − f(a))/(b − a), and it needs no integral at all. They are related in exactly one way: the average rate of change of f is the average value of its derivative f′, courtesy of the Fundamental Theorem of Calculus.

 Average valueAverage rate of change
Formula1/(b − a) · ∫ f dx(f(b) − f(a))/(b − a)
PictureHeight of the equal-area rectangleSlope of the secant line
Guaranteeing theoremMVT for integrals: f(c) = f_avgMVT for derivatives: f′(c) = secant slope
x² on [1, 4](64/3 − 1/3)/3 = 7(16 − 1)/3 = 5

Same function, same interval, two different numbers — 7 and 5. Amusingly, for x² on [0, 3] the two averages coincide at 3, which is pure coincidence: the average value of x² on [0, b] is b²/3 while the average rate of change is b, and b²/3 = b only when b = 3. If your homework answers match on that exact problem, it isn't evidence you used the right formula.

Does the Function Ever Actually Hit Its Average?

Yes — provided it's continuous. The Mean Value Theorem for integrals guarantees at least one c in [a, b] with f(c) = f_avg. For x² on [0, 3] that point is c = √3 ≈ 1.732, since (√3)² = 3. For sin(x) on [0, 2π], where the average is 0, the theorem delivers c = π — and indeed sin(π) = 0. The calculator marks these crossings with a green dot on the dashed average line.

Continuity is doing real work in that guarantee. A step function that equals 0 on [0, 1) and 1 on [1, 2] has average value 1/2 over [0, 2], yet never takes the value 1/2 anywhere — it jumps straight past it. If the c card above reports no crossing, a jump like that is usually why. The general machinery behind these integrals, closed forms included, lives in the full integral calculator.

RMS Voltage, Round Trips, and Expected Value

The most famous average-value computation runs through every wall outlet. Mains electricity in North America peaks at about 170 volts, yet it's sold as "120 V" — because the useful number is the root mean square: the square root of the average value of v(t)². Since sin² averages to exactly 1/2 over a cycle (third row of the table above), RMS voltage is peak/√2 = 170/1.414 ≈ 120.2 V. That's an average-value integral hiding in plain sight on your utility bill.

The same integral answers kinematics questions. Average velocity over a time window is the average value of v(t) — and by the Fundamental Theorem it collapses to displacement over elapsed time, which is why a round trip averages to zero velocity no matter how fast you drove. And in probability, if X is uniformly distributed on [a, b], the expected value E[g(X)] is exactly the average value of g over [a, b] — so a uniform random number squared, drawn from [0, 1], averages to 1/3, the first row of the cheat sheet with n = 2. One formula, three fields, no modifications. That's the payoff for learning it once: type the function, set the interval, and read off the number that sampling could only creep toward.

Frequently Asked Questions

Still Have Questions?

The detailed content on this page provides comprehensive explanations and examples to help you understand better.