If $f : [a,b]\to\Bbb R$ is continuous, are there $x_1,x_2\in (a,b)$ such that $\tfrac{f(b)-f(a)}{b-a} = \tfrac{f(x_1)-f(x_2)}{x_1-x_2}$?

I think this might be a rather geometric proof.

Consider a continuous function $f\colon [a,b]\to \mathbb{R}$. Let $\ell$ be the line that goes through the points $(a,f(a))$ and $(b,f(b))$.

If the graph of $f$ is equal to $\ell$ (or a segment of it, to be more precise), then there is nothing to prove. Note that in this case $$f(x) = \frac{f(b)-f(a)}{b-a}(x-a) +f(a).$$

If the graph of $f$ is not equal to the line $\ell$, then there is one point $(x,f(x))$ on the graph of $f$ that does not lie on the line segment.

Consider a line $\tilde \ell$ that is parallel to the line $\ell$ and lies "between" the point $(x,f(x))$ and the line $\ell$ (i.e. $\tilde \ell$ seperates the point $(x,f(x))$ and the line $\ell$). Now, since $f$ is continuous and the interval $[a,b]$ is connected, the graph of $f$ is also connected. Therefore, the graph of $f$ must intersect $\tilde \ell$ at a point $(x_1,f(x_1))$ with $x_1 \in (a,x)$ and also at another point $(x_2,f(x_2))$ with $x_2 \in (x,b)$. Since these two points lie on $\tilde \ell$, we have $$ \frac{f(b)-f(a)}{b-a} = \frac{f(x_2)-f(x_1)}{x_2-x_1}.$$


You can first prove a Rolle's-theorem-like theorem (Theorem $1$ below) and then prove a mean-value-theorem-like theorem as a corollary (Theorem $2$ below).

Theorem $1$: Let $f:[a,b]\to\Bbb R$ be continuous with $f(a)=f(b)$. Then there exists distinct points $x_1,x_2\in(a,b)$ such that $\frac{f(b)-f(a)}{b-a}=\frac{f(x_1)-f(x_2)}{x_1-x_2}$ (or more simply, $f(x_1)=f(x_2)$).

Proof: For non-triviality, assume $f$ is not constant. So either the maximum value or minimum value is not equal to $f(a)$. Choose a point $c\in(a,b)$ at where $f$ attains maximum/minimum with $f(c)\not=f(a)$. Choose a number $L$ strictly between $f(c)$ and $f(a)$. Then by intermediate value theorem, there exists $x_1\in[a,c]$ and $x_2\in[c,b]$ such that $f(x_1)=L$ and $f(x_2)=L$ and hence $f(x_1)=f(x_2)$. Both points are not equal to $c$ as $L\not=f(c)$ so they are distinct.

Theorem $2$: Let $f:[a,b]\to\Bbb R$ be continuous. Then there exists distinct points $x_1,x_2\in(a,b)$ such that $\frac{f(b)-f(a)}{b-a} = \frac{f(x_1)-f(x_2)}{x_1-x_2}$.

Proof: Define $g:[a,b]\to\Bbb R$, $g(x):=f(x)-\frac{f(b)-f(a)}{b-a}x$, which is continuous. A computation shows that $g(a)=g(b)$: $$g(a)-g(b)=f(a)-\frac{f(b)-f(a)}{b-a}a-\left(f(b)-\frac{f(b)-f(a)}{b-a}b\right)=0.$$

So $g$ satisfies the hypothesis of Theorem $1$. Find the two distinct points $x_1,x_2\in(a,b)$ with $g(x_1)=g(x_2)$.

The last equality says $$f(x_1)-\frac{f(b)-f(a)}{b-a}x_1=f(x_2)-\frac{f(b)-f(a)}{b-a}x_2,$$ which, upon a little manipulation, is the same as $$\frac{f(x_1)-f(x_2)}{x_1-x_2}=\frac{f(b)-f(a)}{b-a}.$$


First, without loss of generality assume that $f(a) = 0$(why can we do this?).

Next, set $h(x) = \frac{f(b)(x-a)}{b-a}$ on the interval $[a,b]$. This function is continuous. Note that $h(a) = 0$ and $h(b) = f(b)$.

Therefore, so is $g(x) = h(x) - f(x)$ on $[a,b]$. Note that $g(a) = 0$ and $g(b) = 0$.


Suppose there existed $x,y$ such that $g(x) = g(y)$ on $[a,b]$. Then, $h(x) - h(y) = f(x) - f(y)$, resulting in $\frac{f(b) - f(a)}{b-a} =\frac{f(x) - f(y)}{x-y}$, while noting that $f(a) = 0$.

Therefore, all we are reduced to proving is that there exist $x,y \in (a,b)$ such that $g(x) = g(y)$, for any continuous function $g$ on $[a,b]$ satisfying $g(a) =g(b) = 0$.


First of all, note that if $g$ is constant then of course we are done.

Without loss of generality, assume that $\max_{[a,b]} g(x) > 0$. (Otherwise, take $-g$). Now, the maximum is attained at a point $z$, where $z \in (a,b)$ (because $g$ is zero at the endpoints). If it is attained in two different points, then we are done by taking those two points. So we assume only one maximum exists.

Let $\delta > 0$ be such that $|y-z| < \delta \implies f(z)> f(y) > 0$. Let $y$ satisfy $|y-z| < \delta$, and $b > y > z$. Then define $l : [a,y] \to \mathbb R$ by $l(x) = g(x) - g(y)$. Note that $l$ is continuous, $l(a) < 0$ and $l(z) > 0$. So there exists $b \in (a,z)$ such that $l(b) = 0$ or that $g(b) = g(y)$. Hence, we are done.


EDIT : Here is the strengthening.

Let $g$ be a non-constant continuous function on $[a,b]$ such that $g(a) = g(b) = 0$(WLOG , $g(y) > 0$ for some $y$) . Let $z$ be any point at which $g(z) = \max_{[a,b]} g$(such a point exists, definitely). Let $d_z = \min\{z-a,b-z\}$. Then for all $v < d_z$, there exist points $x_1,x_2 \in (a,b)$ such that $x_1 - x_2 = v$ and $g(x_1) = g(x_2)$.

Proof : let $J(x)$ be defined on $(z-d_z,z+d_z)$ and be given by $J(x) = g(x) - g(x+v)$. Then, $J(z-v) \leq 0$ and $J(z) \geq 0$, so there is some point $l \in (z-v,z)$ such that $J(l) = 0$, or that $g(l) = g(l+v)$.

Note that if there are many maximums, then choosing a very central maximum(thus maximizing $d_z$) allows us to expand the range of values that $x_1 -x_2$ can attain.