How to apply Mean Value Theorem?

Apply the Mean Value Theorem to show that:

$$|\cos(\frac{x_1}{2}) - \cos(\frac{x_2}{2})| \le \frac12|x_1 - x_2|,\ \text{ for any x_1 and x_2 in [0, 2\pi]}.$$

What I have done is this: use $$f'(c) = [f(b) - f(a)]/(b-a)$$. Here $$2\pi$$ is $$b$$ and 0 is $$a$$. I then treated both $$x_1$$ and $$x_2$$ as $$c$$ like this: $$f'(x_1) = [f(2\pi) - f(0)]/2\pi. I found the function values at$$2\pi$$and at$$0$. I got $$[(\cos\pi - \cos\pi)]/(2\pi-0)$$ which equals $$0$$. I then took the derivative with respect to $$x_1$$. So, $$f'(x1) = -(1/2\sin(x_1/2) - \cos(x_2/2) = 0$$. I did the same thing again, this time using $$x_2$$ and $$f'(x_2)$$ and I got $$0$$ again. So, by applying the MVT to $$x_1$$ and $$x_2$$ I get $$0 \le (1/2)|x_1 - x_2|$$. I really do not think this process is correct. • Write your version of the MVT as (by taking absolute values): $$|f(x_1)-f(x_2)|=|f'(c)|\cdot |x_1-x_2|$$ Let$f(x)=\cos(x/2)$and$c\in [0,2\pi]$. Now, what is the maximum value of$|f'(c)|$? – projectilemotion Sep 5 '19 at 21:48 • Welcome to MSE. Please use MathJax to format your questions. – saulspatz Sep 5 '19 at 21:52 • To find the maximum value of |f ' (c)|, using f(x) = cos(x/2): [f(2π) - f(0)] / 2π. I get | -1/2π | which is 1/2π for the maximum value? – Tim Sep 5 '19 at 22:07 • Nope. What do you get if you differentiate$f(x)\$? – projectilemotion Sep 5 '19 at 22:11
• f ' (x) = -1/2 sin (x/2) – Tim Sep 5 '19 at 22:17

Claim: If $$0 \leq x_1 \lt x_2 \leq 2\pi$$, then $$\left \vert \cos \frac{x_1}{2}- \cos \frac{ x_2}{2} \right \vert \leq \frac 12 \vert x_1 - x_2 \vert.$$
Proof: Define $$f(x)= \cos \frac x2$$. Then $$f'(x)= - \frac 12 \sin \frac x2.$$ Thus, for any $$x_1, x_2 \in [0, 2\pi]$$, the Mean Value Theorem (applied with $$a=x_1, b= x_2$$) tells us $$\exists c$$ with $$x_1 \lt c \lt x_2$$ such that
$$\left \vert \frac {f(x_1)-f(x_2)}{x_1-x_2} \right \vert \leq \vert f'(c) \vert.$$
$$\left \vert \frac{\cos \frac {x_1}{2} - \cos \frac{x_2}{2}}{x_1 - x_2} \right \vert \leq \frac 12 \vert \sin \frac c2 \vert \leq \frac 12.$$
The last inequality holds because $$\vert \sin \frac c2 \vert \leq 1$$ for any (real) value of $$c$$. Now just multiply through by $$\vert x_1-x_2 \vert$$ and the proof is complete.