What is partial derivative of distance to line equation? The distance from a point to a line is given by the equation:
$$ \mbox{distance}\ = \frac{|ax + by +c|}{\sqrt{a^2 + b^2}}$$
What are the partial derivatives of this equation with respect to $a$, $b$, and $c$?
Since this function has an absolute value in it, I think at some points the derivative is undefined. 
Thanks
 A: Yes, the function lacks a derivative when $|ax+by+c|$ is $0$, since the absolute value is not differentiable there - but that makes sense, because if $ax+by+c$ is $0$, that means that $(x,y)$ is on the line, and varying $a$, $b$, or $c$ make $(x,y)$ go to either side of the line, which means that, in the neighborhood of such a point, the distance to line function would look like it bounced off zero, and would therefore have a pointy, non-differentiable place (just like the absolute value function does).
As for differentiating, it should succumb to standard techniques; notice that if we let $f(x)=|x|$, then we can write, where the derivative exists, that $f'(x)=\text{sgn}(x)$ where $\text{sgn}$ is the sign function, which yields $1$ for positive arguments and $-1$ for negative arguments. Thus, for instance the derivative with $c$ would be:
$$\frac{\text{sgn}(ax+by+c)}{\sqrt{a^2+b^2}}$$
which basically says that, if $ax+by+c$ is negative, then increasing $c$ brings the expression closer to $0$, thus decreasing it. If $ax+by+c$ is positive, then increasing $c$ moves the expression further from $0$, increasing it. Using this knowledge and the quotient rule will yield the derivative with $a$ and $b$.
