Find the largest possible value of $\delta$ such that when $|x-y|<\delta$ we get $|\cos x -\cos y|<\sqrt2$.

I drew the graph of $\cos x$ between $[0,2\pi]$. I then visually realized that the value of $|\cos x-\cos y|$ will be less than $\sqrt 2$ if $x$ and $y$ are in $(-\cos^{-1}(\sqrt2-1),\cos^{-1}(\sqrt2-1))$. So we take $\delta=2\cos ^{-1}(\sqrt2-1)$ and since cosine function is uniformity continues this $\delta $ will work for any $x$ and $y$. Am I correct?

  • 2
    $\begingroup$ Since $\cos$ is most sensitive around $\pi/2$, I would say $\cos(\pi/2-\eta)-\cos(\pi/2+\eta)=\sqrt{2}=2\sin(\eta)$ so $\delta=2\eta=\pi/2$ $\endgroup$
    – Evariste
    Commented Aug 21, 2021 at 14:47

2 Answers 2


Using a cosine identity, we have

$\cos x - \cos y = -2\sin \left(\dfrac{x+y}{2}\right) \sin \left(\dfrac{x-y}{2}\right)$

Then, make a change of variables: $u = (x+y)/2$ and $v = (x-y)/2$.

$\cos x - \cos y = -2\sin u \sin v$

So, in the interim, we are searching for the greatest $\delta^*$ such that if $|v| < \delta^*$, we have $|\sin u \sin v| < \sqrt{2}/2$. That is, we are searching for a least upper bounds. So, we look for the smallest possible $v$ such that $|\sin u \sin v| = \sqrt{2}/2$.

Note that $|\sin u \sin v|$ is maximized along the lines $u = \pi/2$ and $u = -\pi/2$, which permits us to write

$|\sin u \sin v| \leq |\sin v|$ (with equality when $u = \pm \pi/2$)

As $\sin v = \sqrt{2}/2$ when $v = \pi/4$, $v = \pi/4$ is our least upper bound $\delta^*$. Thus, if we choose $\delta^* = \pi/4$, we have that

if $|v| < \delta^*$, then $|\sin u \sin v| \leq |\sin v| < \sqrt{2}/2$

As $v = (x-y)/2$, $x-y=2v$, and the corresponding upper bounds $\delta$ for $|x-y|$ gives $\delta = \pi/2$.

Note that if we choose $(x,y)$ such that $|x-y|=\delta = \pi/2$, we have that the points $(x,y) = (3\pi/4,\pi/4)$ and $(x,y) = (-3\pi/4,-\pi/4)$ yield $|\cos x - \cos y| = \sqrt{2}/2$, so we can be sure that this $\delta$ is maximized.


In a question like this, try testing any proposed solution with actual numbers. Does it work if $\delta$ is just slightly smaller than the upper bound you gave? What if $\delta$ is equal to that upper bound?

A calculator will tell you that $\arccos(\sqrt2-1) \approx 1.1437177$ (taking angles in radians), therefore you propose $\delta \approx 2.2874354.$ As pointed out in a comment already, the cosine function is steepest around the input value $\frac\pi2,$ so let's try $x = \frac\pi2 - 1.1437,$ $y = \frac\pi2 + 1.1437$ so that $\lvert x - y\rvert = 2.2874 < \delta.$ Then

\begin{align} \cos\left(\frac\pi2 - 1.1437\right) & \approx 0.910172, \\ \cos\left(\frac\pi2 + 1.1437\right) & \approx -0.910172, \\ \cos x - \cos y & \approx 1.820344 > \sqrt2. \\ \end{align}

Perhaps if you rethink what you "visually realized" you may find your error.

A hint: if you choose $\delta$ correctly, then any interval of width $\delta$ should work, not just an interval of width $\delta$ centered at $0.$ There are intervals $[\theta, \theta + \delta]$ over which the cosine varies more than it does over the interval $\left[-\frac\delta2,\frac\delta2\right].$ Those are the intervals you should be concerned with.

As an aside, I did not even choose the best counterexample above. A better counterexample is $x = \frac\pi4,$ $y = \frac{3\pi}4.$ Then $\lvert x - y\rvert = \frac\pi2 < \delta$ (according to your choice of $\delta$) but $\cos x - \cos y = 2.$ So when looking for counterexamples it may pay to look a little more carefully at what is going on than to just choose something close to the supposed answer. However, the mindless approach worked out OK in this particular case, and any counterexample (no matter how ignorantly guessed) is sufficient to disprove the claim.

  • $\begingroup$ Sorry but what does it mean by 'mindless approach' ? $\endgroup$ Commented Aug 22, 2021 at 1:42
  • $\begingroup$ I mean that I simply looked at your value of $\delta$ and mindlessly chose a number very close to it by truncating the decimal expression. When I did this I was not thinking very much about whether there might be a more powerful counterexample. If the exercise were to find $\delta$ such that $\lvert\cos x-\cos y\rvert<1.9$ then this way of finding a counterexample would have failed, although $x = \frac\pi4,$ $y = \frac{3\pi}4$ would still be a counterexample (provided that you used the same method to find $\delta$). $\endgroup$
    – David K
    Commented Aug 22, 2021 at 2:31
  • $\begingroup$ In short, simply trying numbers near a supposed answer to a question like this will sometimes detect a wrong answer, but it is not guaranteed to detect all wrong answers. Still, it's an easy thing to try and works in many cases. $\endgroup$
    – David K
    Commented Aug 22, 2021 at 2:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .