Math Applets

Mean Value Theorem For Integrals

Mean Value Theorem For Integrals:

Let f:[a,b]Rf : [a,b] \to \mathbb{R} be continuous.
Then there exists a ξ[a,b]\xi \in [a,b] such that

1baabf(x)dx=f(ξ).\frac{1}{b-a}\int_a^b f(x)\, dx = f(\xi).

How to use

  • Drag the blue points aa and bb along the xx-axis to choose the interval.
  • The blue curve is f(x)f(x).
  • The blue shaded region represents the area abf(x)dx\displaystyle \int_a^b f(x)\,dx.
  • The red rectangle has base (ba)(b-a) and height f\overline f (the average value of ff on [a,b][a,b]).
  • The blue point labeled f(ξ)f(\xi) is placed so that f(ξ)=f=1baabf(x)dx.f(\xi)=\overline f=\frac{1}{b-a}\int_a^b f(x)\,dx. A dashed vertical segment drops from f(ξ)f(\xi) to the xx-axis to help you read the corresponding ξ\xi.
  • The gray dashed horizontal lines labeled mm and MM indicate (an approximation of) the minimum and maximum of ff on [a,b][a,b]. They highlight the inequality mfM,m \le \overline f \le M, which guarantees that the horizontal line y=fy=\overline f intersects the graph in the interval.
  • Move aa and bb and watch how the blue shaded area abf(x)dx\int_a^b f(x)\,dx changes.
  • Notice that the red rectangle adjusts its height so that its area matches the integral area.
  • Track the point f(ξ)f(\xi): it always lies on the graph and on the level y=fy=\overline f, illustrating the existence of a mean value point.
  • Try different interval lengths and positions: the average value f\overline f moves up/down, and the displayed ξ\xi shifts accordingly.
Loading graph…
  • Hold Shift + scroll to zoom
  • Hold Shift + drag to move
  • Points shaped like <> act as sliders

Description

Link to code.

Reference: Lecture Notes Calculus 1 ( May22,2022 ) Theorem7.9 page 132 and Figure 7.4

The applet visualizes the Mean Value Theorem for Integrals.

Geometrically, the theorem states that the area of the rectangle with width (ba)(b-a) and height f(ξ)f(\xi) (shown in red) is exactly equal to the area under the curve (the integral).

We use a strictly invertible cubic function.

// f(x) = 0.1x³ + 1
const f = (x: number) => 0.1 * Math.pow(x, 3) + 1;

// Antiderivative F(x) = 0.025x⁴ + x
const F = (x: number) => 0.025 * Math.pow(x, 4) + x;

// Analytical Inverse f⁻¹(y) = ∛(10 * (y - 1))
const fInverse = (y: number) => Math.cbrt(10 * (y - 1));

Using the Fundamental Theorem of Calculus, we calculate the integral as F(b)F(a)F(b) - F(a). We then find the mean value (height) f(ξ)f(\xi) using the theorem:
f(ξ)=F(b)F(a)baf(\xi) = \frac{F(b) - F(a)}{b - a}

const meanValue = () => {
    const { start, end } = interval();
    if (Math.abs(end - start) < 1e-9) return f(start);
    return (F(end) - F(start)) / (end - start);
};

Since the function is invertible, we find the exact coordinate ξ\xi by applying the inverse function f1f^{-1} to the calculated mean value. This allows the applet to update the point f(ξ)f(\xi) without relying on numerical methods.

const getXi = () => {
    const target = meanValue();
    return fInverse(target);
};

The minmin anf maxmax of ff, inside [a,b][a,b], are displayed in gray. Since f(x) is strictly increasing, min is always at start, max is always at end

const extrema = () => {
    const { start, end } = interval();
    return { 
    min: f(start), 
    max: f(end) 
    };
};