# Differentiability of $(x,y)\mapsto|x|\cdot y$

Check the differentiability of the function $f:\mathbb{R}^2\rightarrow \mathbb{R}$ of two variables given by the formula $$f(x)=|x_1|\cdot x_2$$

I still have problems with this. I started by trying to count partial derivatives:

$\displaystyle\frac{\partial f}{\partial x_1}(x)=\lim_{h\to 0}\frac{f(x_1+h,x_2)-f(x_1,x_2)}{h}=\lim_{h\to 0}\frac{|x_1+h|x_2-|x_1|x_2}{h}$, so I think the problems can be at the points: $(0,x_2)$, where $x_2\neq 0$, because then we have that this limit is equal to $\displaystyle\lim_{h\to 0}\frac{|h|x_2}{h}$ which doesn't exist (left and right limits are not equal).

$\displaystyle\frac{\partial f}{\partial x_2}(x)=\lim_{h\to 0}\frac{f(x_1,x_2+h)-f(x_1,x_2)}{h}=\lim_{h \to 0}\frac{|x_1|(x_2+h)-|x_1|x_2}{h}=|x_1|$, so I think we haven't any problems here, this partial derivative always exists.

But what exactly can we deduce from these speculations about partial derivatives?

I've also tried to proudly find the differential of this function. I was taught that the function is differentiable at the point $x$ iff there exists (if there exists, there is only one) a linear mapping $L$ such that $(*)\displaystyle\lim_{h\to 0}\frac{f(x+h)-f(x)-L(h)}{\|h\|}=0$. Then we say that $Df(x)=L$ is a differential of function $f$ at the point $x$. For example consider function $g:\mathbb{R}^2\rightarrow \mathbb{R}, \ g(x)=x_1\cdot x_2$. We can find differential of this function by looking at the increment of this function: $g(x+h)-g(x)=(x_1+h_1)(x_2+h_2)-x_1x_2=x_1h_2+x_2h_1+h_1h_2$ . Then the candidate for $Df(x)$ is linear part of this increment: $L(h)=x_1h_2+x_2h_1$. When we check $(*)$ it appears that indeed it is a desired differential.

But in my example: $f(x+h)-f(x)=|x_1+h_1|(x_2+h_2)-|x_1|x_2$ I'm confused, it seems hard. Do I have to consider a few cases depending on a sign of $x_1, \ x_2$ ?

Can anybody make it clear for me? It is really important to me to finally understand this topic.

-

A necessary condition for a function $f\colon \mathbb{R}^2 \to \mathbb{R}$ to be differentiable at $x_0$ is that both partial derivatives at $x_0$ exist. In this case, $$Df(x_0) \colon (h_1,h_2) \mapsto \frac{\partial f}{\partial x_1}(x_0)h_1 +\frac{\partial f}{\partial x_2}(x_0)h_2.$$ In other words, if the differential exists, then it must have this precise form.

If one partial derivative does not exist at $x_0$, then you can stop. Otherwise, you need to check that the linear mapping $$(h_1,h_2) \mapsto \frac{\partial f}{\partial x_1}(x_0)h_1 +\frac{\partial f}{\partial x_2}(x_0)h_2$$ satisfies the definition of derivative. A sufficient condition for differentiability is that both partial derivatives exist and are continuous around $x_0$.

-
so in my example $\frac{\partial f}{\partial x_1}(x)$ does not exist at the points $(0;x_2)$ for $x_2\neq 0$ and here I can stop and say that the function $f$ is not differentiable? – ray Jun 18 '12 at 11:04
Of course! Listen: if a differential $L$ did exist at $(0,0)$, then we should conclude that $$L(h_1,0) = \frac{\partial f}{\partial x_1}(0,0)h_1,$$ but the right-hand side is not defined. – Siminore Jun 18 '12 at 11:08
I see now. Thank you very much! This observation with formula for $Df(x_0)$ seems to be very useful, I didn't realise it before. Thank you for your answer. – ray Jun 18 '12 at 11:20
You're welcome. Anyway, it follows immediately from the definition of differential. – Siminore Jun 18 '12 at 11:27

Let $g(x_1,x_2)=x_1x_2$, then $g$ is differentiable everywhere with $\partial_1g(x_1,x_2)=x_2$ and $\partial_2g(x_1,x_2)=x_1$.

(1.) Since $f=g$ on the open set $U^+=\{x_1\gt0\}$, $f$ is differentiable on $U^+$ with differential $Dg$.

(2.) Since $f=-g$ on the open set $U^-=\{x_1\lt0\}$, $f$ is differentiable on $U^-$ with differential $-Dg$.

(3.) The last case is $V=\{x_1=0\}$.

(3.i) At any point $x_0=(0,y)$ in $V$, $\frac{f(0+h,y)-f(0,y)}h=\text{sgn}(h)y$ hence $\partial_1f(x_0)$ does not exist if $y\ne0$.

(3.ii) At point $(0,0)$, $|f(h,k)|=|hk|=o(\|(h,k)\|)$ hence $Df(0,0)$ exists and is $Df(0,0)=0$.

To sum up, $f$ is differentiable at $(x_1,x_2)$ if and only if $x_1\ne0$ or $(x_1,x_2)=(0,0)$, and then, $$Df(x_1,x_2):(h,k)\mapsto \text{sgn}(x_1)\cdot x_2\cdot h+|x_1|\cdot k.$$

-