Partial derivative of $g(x,y)=|xy|$ Let $g: \mathbb{R}^2 \to \mathbb{R}$, $g(x,y) = |xy|$. Find all the $(x,y) \in \mathbb{R}^2$ where $g$ is differentiable.
I tried to compute the partial derivatives:
$|\frac{g(x+h,y) - g(x,y)}{h}| = |\frac{|(x+h)y|-|xy|}{h}| \leq |\frac{(x+h)y-xy}{h}|=|y|$.
So the partial derivative $\frac{\partial g}{\partial x}= |y|$. Computing in the same way $\frac{\partial g}{\partial y}= |x|$.
Both of the partial derivatives are continous. Therefore the function itself is differentiable.
According to the solutions this is not correct. There are a few "special cases" where this doesn't hold. Where is my mistake?
 A: The partial derivative of $|xy|=|x||y|$ with respect to $x,$ for example, is $$|y|\frac{x}{|x|},$$ so your computation is incorrect.
A: You have to distinguish cases on the four product $\mathbb{R} ^{\pm} \times\mathbb{R} ^{\pm} $
The mistake in your computation comes from the inequality, the formula of derviation is an equality.
A: Let $g = |xy|$. Which is the same as writing $g= \sqrt{x^2} \sqrt{y^2}$. Now applying the chain rule I get that:
$\frac{\partial g}{\partial x}= |y|\frac{x}{|x|}$ and $\frac{\partial g}{\partial y}= |x|\frac{y}{|y|}$
Since those are continous the function is differentiable $\forall(x,y) \in \mathbb{R}^2 s.t. (x,y) \neq (0,0).$
Now let $(x,y)=(0,0)$:
$\lim_{h \to 0} \frac{f(0+h_1, 0 + h_2) - f(0,0)}{||h||}= \lim_{h \to 0} \frac{|h_1 h_2|}{||h||}$
Now $\frac{|h_1 h_2|}{||h||} \le \frac{h_1^2+h_2^2}{\sqrt{h_1^2+h_2^2}} =\sqrt{h_1^2+h_2^2}$
And $\lim_{h \to 0}\sqrt{h_1^2+h_2^2}= 0$.
Now, I still have to consider the cases: $(x,0)$  and $(0,y)$.
Case 1 $(x,0)$:
$\lim_{h \to 0} \frac{g(h,0)-g(0,y)}{h} = \lim_{h \to 0} \frac{|hy|}{h}=\lim_{h \to 0} \frac{|h|}{h} |y|$. This doesn't exist.
Case 2 $(0,y)$:
Same as Case 1.
So the function is differentiable $\forall(x,y) \in \mathbb{R}^2$ s.t. $(x,y) \neq (x,0) $ and $(x,y) \neq (0,y)$
