Toolvito

Works on this device

Average Function Value Calculator

Type a function and an interval [a, b]. The page works out the average value of the function on that interval, shows the steps, and finds the points c where the function equals its average.

Enter your values

Your values

Use x as the variable, for example x^2, 3x + 1, sin(x) or e^(-x). Write 2x or 2*x for 2 times x.

A number, a fraction such as 1/2, or a value such as pi/4.

It must be greater than a.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

How to use this calculator

  1. Type the function with x as the variable, for example x^2, 3x^2 - 2x + 1 or sin(x).
  2. Type the lower limit a and the upper limit b. You can use numbers, fractions such as 1/2, or values such as pi.
  3. Choose Calculate. Read the average value, the integral, the steps and the values of c.

How to type a function

  • Use +, -, *, / and ^ for powers. Brackets ( ) group things. 2x means 2 times x.
  • Functions: sin, cos, tan, asin, acos, atan, sqrt, abs, ln, log, exp. They need brackets: sin(x).
  • Constants: pi and e. Angles are in radians. ln is the natural logarithm and log is the logarithm to base 10.

The formula

The average value of f on [a, b] is f_avg = 1 ÷ (b − a) × ∫ from a to b of f(x) dx.

It is the height of a rectangle on [a, b] with the same area as the region under the curve (area below the x-axis counts as negative).

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_avg.

The method

  • Polynomials with whole-number or fraction coefficients are integrated exactly. The page builds the antiderivative F and works out F(b) − F(a). With exact limits, the average is an exact fraction.
  • Other functions are integrated numerically with adaptive Simpson's rule. The page shows an estimate of the error of the integral.
  • Values of c are found on a grid of 2,000 steps where f − f_avg changes sign. Each one is made more exact by halving the step.

Worked example

Take f(x) = x^2 on [0, 3]. An antiderivative is F(x) = (1/3)x^3. So the integral is F(3) − F(0) = 9 − 0 = 9.

The average value is 9 ÷ (3 − 0) = 3. The value of c with c^2 = 3 is c = √3 ≈ 1.732050808.

For f(x) = sin(x) on [0, pi], the integral is 2, so the average value is 2 ÷ pi ≈ 0.6366197724.

Limits you should know

  • f must have a value at every x from a to b. Improper integrals (such as 1 ÷ √x on [0, 1]) are not worked out; the page says where f has no value.
  • If the numeric method does not settle (for example near a vertical asymptote inside [a, b]), the page says so and shows no average.
  • Values of c are searched on a grid. Two values very close together, or a point where f − f_avg only touches 0, can be missed.
  • Results are shown with 10 significant digits. Exact fractions are shown for polynomials with exact limits.

Related tools