Average Value Calculator

  • Free
  • No sign-up
  • Works on phones
  • Shows the working
Integral#15

Average Value of a Function

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

This average value of a function calculator finds the mean height of ( f(x) ) over an interval ( [a, b] ). First, enter the function and the endpoints. It returns the definite integral, the average value ( f_{text{avg}} ), and the x-values ( c ) where the function actually reaches that average.

It is useful for calculus homework, for checking the Mean Value Theorem for integrals, and for practical averages such as mean temperature or mean speed over time. Free, no sign-up.

Average value of a function calculator: The average value of f(x) = x² on [0, 3] is 3: the dashed rectangle of height 3 has…
The average value of f(x) = x² on [0, 3] is 3: the dashed rectangle of height 3 has the same area (9) as the region under the curve.

How to use the average value of a function calculator

  1. Enter ( f(x) ). Use ^ for powers, sqrt(), sin(), ln(), e^(x) and pi. Also, implicit multiplication works: 3x^2, x e^x, 10 sin(pi x/12).
  2. Enter the interval endpoints ( a ) and ( b ), with ( a < b ). For example, values like pi or 2pi are fine.
  3. Press Average.
  4. Read three results: ( int_a^b f(x),dx ), the average value ( f_{text{avg}} ), and the point or points ( c ) with ( f(c) = f_{text{avg}} ).

Formula

The average value of ( f ) on ( [a, b] ) is the integral divided by the length of the interval:

An infinity symbol with mathematical equations and coordinates floating inside it.

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

Think of it as the height of a rectangle on ( [a, b] ) with the same area as the region under the curve. Also, it is the continuous version of “add up the values and divide by how many there are”.

If ( f ) is continuous, the Mean Value Theorem for integrals guarantees at least one ( c ) in ( [a, b] ) with ( f(c) = f_{text{avg}} ). The calculator searches the interval and lists such points. See the average value guide for the geometric picture and the Mean Value Theorem for why ( c ) must exist.

Worked examples

Example 1. Find the average value of ( f(x) = 3x^2 – 2x ) on ( [0, 2] ), and the point where it is attained.

A person writing in a notebook with a coffee cup and phone nearby.

The integral is

$$int_0^2 (3x^2 - 2x),dx = left[x^3 - x^2right]_0^2 = 8 - 4 = 4$$

Divide by the length ( b – a = 2 ): ( f_{text{avg}} = 2 ).

Now solve ( 3c^2 – 2c = 2 ), that is ( 3c^2 – 2c – 2 = 0 ). The quadratic formula gives ( c = frac{1 pm sqrt{7}}{3} ). Only the plus sign lands inside ( [0, 2] ):

$$c = frac{1 + sqrt{7}}{3} approx 1.21525$$

Type 3x^2 - 2x with limits 0 and 2 in the calculator above: it shows the integral 4, the average 2, and ( c approx 1.2152504 ).

Example 2 (a real average). A room’s temperature in degrees Fahrenheit over 12 hours is modeled by ( T(t) = 60 + 10sinleft(frac{pi t}{12}right) ). What is the average temperature?

The calculator uses ( x ), so enter 60 + 10 sin(pi x/12) on ( [0, 12] ). By hand, ( int_0^{12} sinleft(frac{pi t}{12}right) dt = frac{24}{pi} ), so

$$T_{text{avg}} = frac{1}{12}left(720 + frac{240}{pi}right) = 60 + frac{20}{pi} approx 66.37$$

The average is about 66.37 °F, well below the 70 °F peak, because the temperature spends most of the time below its maximum.

Common mistakes

  • Forgetting to divide by ( b – a ). The integral alone, which is what the definite integral calculator returns, is the total (area), not the average.
  • Averaging the endpoint values. ( frac{f(a) + f(b)}{2} ) is only the average for straight lines. For example, in Example 1 it would give 4, not 2.
  • Confusing it with average rate of change. ( frac{f(b) – f(a)}{b – a} ) is the average slope, a different quantity. Also, it is the one the mean value theorem calculator works with.
  • Expecting a positive answer. Parts of the graph below the x-axis pull the average down. For example, for ( x^3 ) on ( [-1, 1] ), the average value is 0 by symmetry.

Worked example: average temperature over a day

A model of the temperature is \( T(t) = 10 + 5\sin\left(\frac{\pi t}{12}\right) \) °C for \( t \) from 0 to 24 hours. The sine part completes one full cycle, so its integral is zero, and

$$T_{\text{avg}} = \frac{1}{24}\int_0^{24} T(t)\,dt = \frac{1}{24}(240 + 0) = 10 \text{ °C}$$

Average velocity

The average value of a velocity function is the average velocity, which equals displacement divided by time. For \( v(t) = 3t^2 \) m/s from \( t = 0 \) to 2: the displacement is \( \int_0^2 3t^2\,dt = 8 \) m, so the average velocity is \( 8/2 = 4 \) m/s.

The mean value theorem for integrals

If \( f \) is continuous on \( [a, b] \), there is at least one \( c \) in the interval where \( f(c) \) equals the average value. For \( v(t) = 3t^2 \) on \( [0, 2] \), \( 3c^2 = 4 \) gives \( c = \frac{2}{\sqrt{3}} \approx 1.155 \) s: at that moment the instantaneous velocity equals the average. See the mean value theorem calculator.

Average of sine over half a wave

\( \frac{1}{\pi}\int_0^{\pi} \sin x\,dx = \frac{2}{\pi} \approx 0.637 \). This is why the average of a rectified alternating current is about 63.7% of its peak. Electricians use a different average, the root mean square (RMS), \( \frac{1}{\sqrt{2}} \approx 0.707 \) of the peak, because power depends on the square of the current.

Step-by-step method

  1. Check that \( f \) is continuous on \( [a, b] \).
  2. Compute \( \int_a^b f(x)\,dx \) (the definite integral calculator helps).
  3. Divide by the interval length \( b - a \).
  4. If asked, solve \( f(c) = f_{\text{avg}} \) for the point where the function equals its average.

Why divide by the length?

Dividing the total by the interval length turns an area into a height: the average value is the height of the rectangle with the same area as the region under the curve.

Practice problems

  1. Average value of \( f(x) = x^2 \) on \( [0, 3] \).
  2. Average value of \( f(x) = \frac{1}{x} \) on \( [1, e] \).

Answers: 1. \( \frac{1}{3} \times 9 = 3 \). 2. \( \frac{1}{e - 1} \times 1 \approx 0.582 \).

Related guides

Further reading

FAQ

How do you find the average value of a function?

First, integrate ( f ) from ( a ) to ( b ) and divide by ( b – a ). The calculator shows both the integral and the result.

What does the value c mean?

It is a point in the interval where the function equals its average value. The Mean Value Theorem for integrals guarantees at least one such point for a continuous function; there can be several.

Can the average value of a function be negative?

Yes. If more of the graph lies below the x-axis than above it (weighted by area), the average is negative.

Is the average value calculator free to use?

Yes. It is free, works in any browser and needs no account.

Embed this calculator on your website

Teachers, tutors and bloggers are welcome to use this calculator for free. Copy the code below and paste it into any page (in WordPress, use a "Custom HTML" block). The small script makes the calculator grow to fit its answer; if your site removes scripts, it still works at a fixed height. Please keep the credit link.

More calculators

See all calculators