# Linear Approximation and Differentiability

We know that linear approximation applies if a function is differentiable; that is, if for $f(x,y)$: $$\lim_{(h,k)\to (0,0)} \frac{f(a+h,b+k)-f(a,b)-hf_x(a,b)-kf_y(a,b)}{\sqrt{h^2+k^2}}=0$$

Since this is often difficult to compute, the following condition is usually used:

If the partial derivatives $f_x$ and $f_y$ exist near $(a,b)$ and are continuous at $(a,b)$, then $f$ is differentiable at $(a,b)$.

Now, I am trying to find whether linear approximation applies for $f(x,y)=x \cos y$ at the point $(x_0,y_0)=(0,0)$. We find that $f_x(x,y)=\cos y$ and $f_y(x,y)=-x\sin y$. Using the above criterion, $f$ should be differentiable at $(0,0)$, since $f_x(0,0)=1$ and $f_y(0,0)=0$, which are both continuous.

This is all fine, but when I try to use the definition of differentiability, I encounter a problem:

$$\lim_{(h,k)\to (0,0)} \frac{f(h,k)-f(0,0)-hf_x(0,0)-kf_y(0,0)}{\sqrt{h^2+k^2}}=\lim_{(h,k)\to (0,0)}\frac{h(\cos k-1)}{\sqrt{h^2+k^2}}$$ I have not managed to compute this limit manually, but Wolfram|Alpha claims that it does not exist. My question is: how can this limit not exist (implying the function is not differentiable) when the other condition was satisfied. Did I make a mistake somewhere in the process, or is it not supposed to agree in this case? Thank you for any assistance!

• First of all: your partial derivatives are indeed continuous, but not because $f_x(0,0)=1$ and $f_y(0,0)=0$. – luka5z Oct 12 '15 at 19:24
• As for the limit: it is $0$. Probably you entered something in a wrong way into wolfram. You can easily show that this limit is $0$ without refering to wolfram. – luka5z Oct 12 '15 at 19:26
• Would I explicitly have to check continuity as $\lim_{(x,y)\to (x_0,y_0)} f(x,y)=f(x_0,y_0)$? – Douglas Fir Oct 12 '15 at 19:27
• Why? Look how $f_x$ and $f_y$ look like. Cosine and linear function are continuous, so is their product... btw: differentiability implies continuity. – luka5z Oct 12 '15 at 19:28
• Okay, so the definition does agree with the other condition. Now I am wondering: is there a quick way to show that the last limit goes to $0$? I'm not exactly sure how I would find that. – Douglas Fir Oct 12 '15 at 20:01

Use polar coordinates ($h=r\cos\phi$ and $k=r\sin\phi$). It's completely straightforward.
$$\lim_{(h,k)\to (0,0)}\frac{h(\cos k-1)}{\sqrt{h^2+k^2}}=\lim_{r\rightarrow 0} \frac{r\cos\phi(\cos(r\sin\phi)-1))}{r}=\lim_{r\rightarrow 0} \cos\phi(\cos(r\sin\phi)-1))=0$$
Since $$|h|\leq \sqrt{h^2+k^2},$$ and $$|\cos k-1|\leq \frac{1}{2}k^2\leq \frac{1}{2}(h^2+k^2),$$ you find that $$\Bigl|\frac{h(\cos k-1)}{\sqrt{h^2+k^2}}-0\Bigr|\leq \frac{1}{2}(h^2+k^2),$$ and $\frac{1}{2}(h^2+k^2)$ clearly has limit $0$ when $(h,k)\to(0,0)$. Hence $$\lim_{(h,k)\to(0,0)}\frac{h(\cos k-1)}{\sqrt{h^2+k^2}}=0.$$ (I had written almost all of this, and then I realized you had selected another answer. I post it anyways, since it does not use polar coordinates.)