TITLE: continuity of a functions involving trig functions
QUESTION [5 upvotes]: LEt $f$ be given as
$$
f(x,y) =
\begin{cases}
\frac{ \sin x - \sin y }{x-y}, & \text{if }\text{ $x \neq y $} \\
\cos x, & \text{if } x \text{ $=y$}
\end{cases}
$$
Notice when $y=x$, along the diagonal, $f = \cos x$ which is continuous everywhere. if $y \neq x$, then $f(x,y) = \frac{ \sin x - \sin y}{x-y}$, which I claim is continuous also everywhere. To show this, let $\epsilon > 0$ be given. and take $(x,y), (u,v) \in \mathbb{R}^2 \setminus \{ (t,t) \} $. We want to estimate
$$ \left| \frac{ \sin x - \sin y }{x-y} - \frac{ \sin u - \sin v }{u-v} \right|$$
given that $||(x,y) - (u,v)|| = \sqrt{ (x-u)^2 + (y-v)^2} < \delta $ for some $\delta > 0 $. How can I estimate so that we can choose an appropiate $\delta$ ?

REPLY [5 votes]: It is only at points $(k,k)$ where the continuity is not immediate: If $(a,b)$ is a point for which $a \neq b$ then since sine is continuous, and the denominator $x-y$ approaches $a-b \neq 0$ as $(x,y) \to (a,b),$ the function $f$ is continuous at $(a,b)$. So it only remains to look at points $(a,b)$ for which $a=b$. Near these points, the piecewise function for $f$ sometimes uses the one rule, sometimes the other, depending on whether $x=y$. So some care has to be taken to argue about the limit as $(x,y) \to (k,k),$ and the following is a way to tack things down using the mean value theorem.
If $x \neq y$ then using the mean value theorem, we have
$$h(x,y)=\frac{\sin x - \sin y}{x-y}=\cos(c_{x,y}),$$ 
where $c_{x,y}$ is between $x$ and $y$ [i.e. if $x<y$ then $c_{x,y} \in (x,y)$ otherwise $c_{x,y} \in (y,x).$]
Then if $(x,y) \to (k,k)$ in any manner, we will certainly have either $f(x,y)=\cos(x)$ [when $x=y$] or else $f(x,y)=\cos(c_{x,y})$, and since $(x,y) \to (k,k)$ implies $|x-y| \to 0$ along with $x,y \to k$ we can use continuity of $\cos(x)$ to arrive at $\lim_{(x,y) \to (k,k)}f(x,y)=\cos(k).$