Math Applets

Cauchy’s mean value theorem

Cauchy’s mean value theorem:

Let f,g:[a,b]Rf, g : [a, b] \to \mathbb{R} be continuous as well as differentiable on (a,b)(a, b).
Let further g(x)0g'(x) \neq 0 for all x(a,b)x \in (a, b).
Then g(a)g(b)g(a) \neq g(b) and there exists a ξ(a,b)\xi \in (a, b) such that

f(b)f(a)g(b)g(a)=f(ξ)g(ξ).\frac{f(b) - f(a)}{g(b) - g(a)} = \frac{f'(\xi)}{g'(\xi)}.

Example 1, from math.stackexchange

How to use the applet:

  • Drag the blue points aa and bb along the xx-axis to choose the interval [a,b][a,b].
  • Drag the purple point ξ\xi along the xx-axis (it is constrained to stay inside [a,b][a,b]).
  • The blue curve is f(x)f(x).
  • The orange curve is rg(x)r\,g(x), wherer=f(b)f(a)g(b)g(a).r=\frac{f(b)-f(a)}{g(b)-g(a)}.
  • The red curve (in the lower panel) is h(x)=f(x)rg(x),h(x)=f(x)-r\,g(x), constructed so that h(a)=h(b)h(a)=h(b).
  1. First choose aa and bb. The applet automatically recomputes rr so that the endpoints of hh match.
  2. Now move ξ\xi and look at the tangents at x=ξx=\xi.
    • When you hit a point where h(ξ)0h'(\xi)\approx 0, the applet highlights ξ\xi (turns green).
  3. At such a ξ\xi, the tangents to ff and rgr\,g have the same slope, because
h(ξ)=f(ξ)rg(ξ)=0f(ξ)g(ξ)=r=f(b)f(a)g(b)g(a). h'(\xi)=f'(\xi)-r\,g'(\xi)=0 \quad\Longleftrightarrow\quad \frac{f'(\xi)}{g'(\xi)}=r =\frac{f(b)-f(a)}{g(b)-g(a)}.
Loading graph…
  • Hold Shift + scroll to zoom
  • Hold Shift + drag to move
  • Points shaped like <> act as sliders

Example 2, extension of MVT as parametric curve

How to use

Instead of drawing ff and gg as graphs in the (x,y)(x,y)-plane, we look at the parametric curve γ(t)=(g(t),f(t))\gamma(t)=(g(t),\,f(t)) in the (g,f)(g,f)-plane. In this applet g(t)=tg(t)=t, so the horizontal coordinate is just tt.

  • Drag the green point A=(g(a),f(a))A=(g(a),f(a)) and the red point B=(g(b),f(b))B=(g(b),f(b)) along the blue curve γ\gamma. (They determine the parameters aa and bb, i.e. the interval [a,b][a,b].)
  • The orange line is the secant through AA and BB in the (g,f)(g,f)-plane. Its slope is f(b)f(a)g(b)g(a).\frac{f(b)-f(a)}{g(b)-g(a)}.
  • The purple point is γ(ξ)=(g(ξ),f(ξ))\gamma(\xi)=(g(\xi),f(\xi)), and the purple line is drawn parallel to the secant through that point.
  • CMVT guarantees that there exists ξ(a,b)\xi\in(a,b) such that
f(b)f(a)g(b)g(a)=f(ξ)g(ξ). \frac{f(b)-f(a)}{g(b)-g(a)}=\frac{f'(\xi)}{g'(\xi)}.
  • In the (g,f)(g,f)-plane, the derivative ratio f(ξ)g(ξ)\frac{f'(\xi)}{g'(\xi)} is exactly the slope of the tangent to γ\gamma at ξ\xi (because γ(t)=(g(t),f(t))\gamma'(t)=(g'(t),f'(t))). So “parallel to the secant” is the geometric way to see the theorem.
  • The applet computes one such ξ\xi automatically (so you can focus on the geometry rather than solving the equation by hand).

Loading graph…
  • Hold Shift + scroll to zoom
  • Hold Shift + drag to move
  • Points shaped like <> act as sliders

Description

Reference: Lecture Notes Calculus 1 ( May22,2022 ) Lemma6.15 page 109 The applet are an attempt to show the Cauchy’s mean value theorem.

Example 1

Link to code.

This example is taken from this Math StackExchange answer.

The argument is closed to the proof used in the lecture notes, and provides a nice geometric interpretation.

Given an interval [a,b][a,b], the applet displays the functions f(x)f(x), rg(x)r\,g(x), and

h(x)=f(x)rg(x),r=f(b)f(a)g(b)g(a). h(x)=f(x)-r\,g(x), \qquad r=\frac{f(b)-f(a)}{g(b)-g(a)}.

The choice of rr is designed so that the endpoints match:

h(a)=h(b). h(a)=h(b).

Therefore, by Rolle’s Theorem, there exists ξ(a,b)\xi\in(a,b) such that

h(ξ)=0. h'(\xi)=0.

Since rr is constant once aa and bb are fixed, the derivative is

h(x)=f(x)rg(x), h'(x)=f'(x)-r\,g'(x),

computed analytically as a combination of ff' and gg'.

const getR = () => {
    const a = getA();
    const b = getB();
    const denom = g(b) - g(a);
    if (Math.abs(denom) < 1e-10) return NaN;
    return (f(b) - f(a)) / denom;
};

// h'(x) = f'(x) - r g'(x)
const dh = (x: number) => df(x) - getR() * dg(x);

After fixing aa and bb, the student can move the point ξ\xi along the interval and try to satisfy the condition h(ξ)0h'(\xi)\approx 0.
When this happens, the applet highlights the geometric meaning of the theorem: at x=ξx=\xi the tangents to ff and rgr\,g have the same slope, which corresponds to the CMVT conclusion

f(ξ)g(ξ)=f(b)f(a)g(b)g(a). \frac{f'(\xi)}{g'(\xi)}=\frac{f(b)-f(a)}{g(b)-g(a)}.

Example 2

Link to code. This applet visualizes Cauchy’s Mean Value Theorem (CMVT) through a geometric interpretation in the (g,f)(g,f)-plane.

Instead of drawing the graphs of ff and gg in the usual (x,y)(x,y)-plane, we consider the parametric curve

γ(t)=(g(t),f(t)). \gamma(t) = (g(t),\, f(t)).
const curve = board.create(
  "curve",
  [(t: number) => g(t), (t: number) => f(t), xmin, xmax],
  { strokeColor: COLORS.blue, strokeWidth: 4 }
) as JXG.Curve;

We choose a particularly simple function

g(t)=t, g(t)=t,

so that:

  • g(t)=10g'(t)=1\neq 0 everywhere),
  • g1(u)=ug^{-1}(u)=u is known explicitly,
  • the parameter tt is exactly the x–coordinate of the point on the curve.

Two movable points (g(a),f(a)) (g(a),f(a)) (green) and (g(b),f(b))(g(b),f(b)) (red). The applet draws the secant line through (g(a),f(a))(g(a),f(a)) and (g(b),f(b))(g(b),f(b)).

In this applet we take:

f(t)=0.3t3t,f(t)=0.9t21, f(t)=0.3t^3-t,\qquad f'(t)=0.9t^2-1, g(t)=t,g(t)=1. g(t)=t,\qquad g'(t)=1.

Let

dF=f(b)f(a),dG=g(b)g(a)=ba. dF=f(b)-f(a),\qquad dG=g(b)-g(a)=b-a.

Then

h(t)=dFg(t)dGf(t)=dFdG(0.9t21). h'(t)=dF\cdot g'(t)-dG\cdot f'(t) =dF - dG(0.9t^2-1).

Expand:

h(t)=dF0.9dGt2+dG=(dF+dG)0.9dGt2. h'(t)=dF - 0.9dG\,t^2 + dG =(dF+dG) - 0.9dG\,t^2.

To find ξ\xi, we solve h(t)=0h'(t)=0:

(dF+dG)0.9dGt2=0t2=dF+dG0.9dG. (dF+dG) - 0.9dG\,t^2=0 \quad\Longrightarrow\quad t^2=\frac{dF+dG}{0.9\,dG}.

This is why in the code findXi() computes:

  • the interval endpoints in parameter space:
    • left = min(a,b), right = max(a,b)
  • dF = f(right) - f(left)
  • dG = right - left
  • then
t2=dF+dG0.9dG t2 = \frac{dF+dG}{0.9\,dG}

as t2 = (dF + dG) / (0.9 * dG).

Since t2=t2t^2=t2, the candidates are

t=+t2andt=t2. t = +\sqrt{t2}\quad\text{and}\quad t = -\sqrt{t2}.

The code then:

  1. discards the case t2<0t2<0 (no real square root; numerically this can occur for some endpoint choices),
  2. checks which candidate lies inside left, right,
  3. returns that one (if both are inside, it picks the one closer to the midpoint).

Finally the tangnet at ξ\xi should be parallel to the secant:

// Secant line AB
const secant = board.create("line", [A, B], {
  strokeColor: COLORS.orange,
  strokeWidth: 3,
}) as JXG.Line;

// ξ point on the parametric curve
const Xi = board.create(
  "point",
  [() => g(findXi()), () => f(findXi())],
  { name: "", size: 5, fixed: true, strokeColor: COLORS.purple, fillColor: COLORS.purple }
) as JXG.Point;

board.create("parallel", [secant, Xi], {
  strokeColor: COLORS.purple,
  strokeWidth: 3,
});