# Differentiability of a function

1. Nov 14, 2013

### Felafel

1. The problem statement, all variables and given/known data
I have the function f, defined as follows:
f=0 if xy=0
f= $xysin(\frac{1}{xy})$ if $xy \neq 0$

Study the differentiability of this function.

3. The attempt at a solution

there are no problems in differentiating the function where $xy\neq0$.
the partials in (0,0) are both zero.
If i consider xy as a single variable i get from the definition of differential that:
$\lim_{xy \to 0} \frac{f(xy)-f(0)-\nabla f(0)(xy)}{\sqrt{(xy)^2-0}}$=$\lim_{xy \to 0} \frac{xy sin(1/xy)}{xy}$ doesn't exist

On the other hand, if i consider x,y separately i get:
$\lim_{(x,y) \to (0,0)} \frac{f(x,y)-f(0,0)-\nabla f(0,0)(x,y)}{\sqrt{x^2+y^2}}$=$\lim_{xy \to 0} \frac{xy sin(1/xy)}{\sqrt{x^2+y^2}}=0$ and thus the function is differentiable even when x,y are 0.

these two results are conflicting. what am i doing wrong?

2. Nov 14, 2013

### Staff: Mentor

The results are not conflicting. The existence of the partial derivatives is not sufficient to have a differentiable function.

3. Nov 14, 2013

### Felafel

yes, i know that, but ny problem is that the differential doesn't exist if i consider xy as a single variable, but it does if i consider x and y separately, please look at the two different applications of the definition of differentiability i wrote

4. Nov 14, 2013

### PeroK

I don't think that the partial derivatives exist (except trivially for x = 0 and y = 0). E.g.

$\frac{\partial{f}}{\partial{x}}|_{(0,y)} \ = \lim_{x \rightarrow 0}\frac{xysin(\frac{1}{xy})}{x} = \lim_{x \rightarrow 0}ysin(\frac{1}{xy})$

Which doesn't exist.

5. Nov 15, 2013

### Felafel

should I deduce than that it is differentiable only in (0,0)?

6. Nov 15, 2013

### PeroK

Yes, it's differentiable at (0, 0) but nowhere else on the x- and y-axes.

7. Nov 15, 2013

### Staff: Mentor

You did not use the definition of differentiability in (x,y) at all. If the function would be differentiable at (0,0), both derivative attempts would have to work. They do not, showing your function is not differentiable at that point.

Last edited: Nov 15, 2013
8. Nov 15, 2013

### PeroK

Why is the function not differentiable at (0,0)?

9. Nov 15, 2013

### Staff: Mentor

This post (and #11 and #13) is wrong, see post 15

It is not even continuous.

Consider (x,y)=(h,h) with h≠0. Then $f(h,h)=h^2 \sin(\frac{1}{h^2}) > h^2 \frac{1}{2h^2} = \frac{1}{2}$ using sin(x)>x/2 for small x>0.
Clearly the limit for $h \to 0$ cannot be 0, but f(0,0) is zero.

Last edited: Nov 15, 2013
10. Nov 15, 2013

### PeroK

I'm not sure about $sin(x) > 1/(2x)$ given that $|sin(x)| \le 1$

As (x, y) -> (0,0), $\frac{xy}{\sqrt{x^2+y^2}} → 0$

11. Nov 15, 2013

### Staff: Mentor

I don't see the connection of your global upper bound to my local lower bound (valid at least up to pi/2).
Plot

I should have specified x>0 in "sin(x)>1/(2x) for small x", but that is not an issue as h^2 is always positive (I edited it in my previous post now).

Where does the denominator come from?

12. Nov 15, 2013

### PeroK

Ok, so take x = 0.1:

1/2x = 1/0.2 = 5

And sin(anything) can't possibly be > 5

13. Nov 15, 2013

### Staff: Mentor

Sorry, my mistake. I meant sin(x)>x/2 (for 0<x<pi/2). The plot and the application to calculate the limit were correct.

14. Nov 15, 2013

### PeroK

$\lim_{h→0}h^2 \sin(\frac{1}{h^2}) = 0$

If h is getting small and |sin| is bounded by 1, then that limit must be zero, surely?

$1/h^2$ is getting very large, not very small

15. Nov 15, 2013

### Staff: Mentor

You are right, the function is differentiable. Sorry for the confusion.

I really need that free weekend now...

16. Nov 16, 2013

### Felafel

thank you very much :)