1. ## Differentiating Absolute Values

How do we differentiate $\displaystyle f(x,y)=|xy|$? I know that the derivative of $\displaystyle xy$ itself is $\displaystyle x+y$, and the derivative with respect to x and y are respectively $\displaystyle f_x=y$ and $\displaystyle f_y=x$. But I don't understand how to find the derivatives with the absolute value signs. Can anyone show me?

2. ## Consider a separate function

To make myself clearer I am going to consider the function $\displaystyle f(x) = |x|$. This function can be rewritten as:

$\displaystyle f(x) = \left\{ \begin{matrix} x & \mbox{ if } 0 \leq x \\ -x & \mbox{ if } 0 > x \ \end{matrix} \right.$

So the derivative is:

$\displaystyle f'(x) = \left\{ \begin{matrix} 1 & \mbox{ if } 0 < x \\ -1 & \mbox{ if } 0 > x \ \end{matrix} \right.$

It can be shown that in x = 0 the derivative does not exist. Apply this idea to your function.

3. Originally Posted by Diego
To make myself clearer I am going to consider the function $\displaystyle f(x) = |x|$. This function can be rewritten as:

$\displaystyle f(x) = \left\{ \begin{matrix} x & \mbox{ if } 0 \leq x \\ -x & \mbox{ if } 0 > x \ \end{matrix} \right.$

So the derivative is:

$\displaystyle f'(x) = \left\{ \begin{matrix} 1 & \mbox{ if } 0 < x \\ -1 & \mbox{ if } 0 > x \ \end{matrix} \right.$

It can be shown that in x = 0 the derivative does not exist. Apply this idea to your function.
I kind of knew this definition but I don't see how it helps us to find the derivative... I know that the derivative of $\displaystyle |x|$ is $\displaystyle \frac{x}{|x|}$. But how do we get this from the definition you've posted?

4. ## Apply the definition of derivative to different parts of the function

Suppose x > 0 then just apply the definition:

$\displaystyle \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}= \lim_{h \to 0} \frac{x+h - x}{h} = \lim_{h \to 0} \frac{h}{h}= \lim_{h \to 0} 1 = 1$

Suppose x < 0 then:

$\displaystyle \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}= \lim_{h \to 0} \frac{-x-h + x}{h} = \lim_{h \to 0} \frac{-h}{h}= \lim_{h \to 0} -1 = -1$

Now if x = 0

$\displaystyle \lim_{h \to 0^{+}} \frac{f(x+h) - f(x)}{h}= \lim_{h \to 0^{+}} \frac{h}{h}= \lim_{h \to 0^{+}} 1 = 1$

and:

$\displaystyle \lim_{h \to 0^{-}} \frac{f(x+h) - f(x)}{h}= \lim_{h \to 0^{-}} \frac{-h}{h}= \lim_{h \to 0^{-}} -1 = -1$

thus the derivative on zero does not exist.

$\displaystyle f'(x) = \frac{x}{|x|}$, provided x is not zero, is just a compact way of writing the derivative, but is still the same function as:

$\displaystyle f'(x) = \left\{ \begin{matrix} 1 & \mbox{ if } 0 < x \\ -1 & \mbox{ if } 0 > x \ \end{matrix} \right.$

Maybe what you wanted to know is if you can obtain the derivative in the form x/|x| by consdering any x, I do not know if this is possible, but in any case I don't think it is that important, because you still obtain the same result. I hope this was the answer you were looking for, if not do tell me.

5. Well, you could apply the chain rule.

Let $\displaystyle f=|xy|$ and $\displaystyle u=xy$, so $\displaystyle f = |u|$

$\displaystyle \frac{\partial f}{\partial x} = \frac{df}{du} \cdot \frac{\partial u}{\partial x} = \frac{u}{|u|} \cdot y = \frac{xy}{|xy|} \cdot y$

$\displaystyle = \frac{xy^2}{|xy|} = \frac{x|y|}{|x|}$

$\displaystyle xy \neq 0$

6. First let me point out that the statement of the "one thing you know" was wrong. The derivative of xy is NOT xy. If you are differentiating with respect to x and y is a function of x, it is x+ xy'. If you are differentiating with respect to y and x is a function of y, it is y+ yx'. If x and y are both functions of some parameter and you are differentiating with respect to that parameter it is x'y+ xy'. If x and y are independent variable, the partial derivatives are $\displaystyle xy_y= x$ and $\displaystyle xy_x= y$.

For |xy|, assuming x and y are independent variables,
In the first quadrant, x> 0, y> 0 so |xy|= xy and the partial derivatives are $\displaystyle |xy|_x= (xy)_x= y$ and $\displaystyle |xy|_y= (xy)_y= x$

In the second quadrant, x< 0 and y> 0 so |xy|= -xy and the partial derivatives are $\displaystyle |xy|_x= (-xy)_x= -y$ and $\displaystyle |xy|_y= (xy)_y= -x$.

In the third quadrant, x< 0 and y< 0 so xy> 0, |xy|= xy and the partial derivatives are $\displaystyle |xy|_x= (xy)_x= y$ and $\displaystyle |xy|_y= (xy)_y= x$.

In the fourth quadrant, x> 0 and y< 0 so |xy|= -xy and the partial derivatives are $\displaystyle |xy|_x= (-xy)_x= -y$ and $\displaystyle |xy|_y= (xy)_y= -x$.

Of course, |xy| is not differentiable if either x or y is 0- that is, on the axes.