# How do you differentiate f(x) = abs(5x-2)?

Jun 21, 2015

This graph has two derivatives, and an undefined one at its corner. The two derivatives are simply the positive and the negative slope, so the graph's right half has a derivative of $5$ and its left half, $- 5$. Its corner would be where $5 x - 2$ and $- 5 x + 2$ meet.

$5 x - 2 = - 5 x + 2$
$10 x = 4$
$x = \frac{2}{5}$

$\pm \left(5 \left(\frac{2}{5}\right) - 2\right) = 2 - 2 = 0$

Therefore, the two halves meet at $\left(\frac{2}{5} , 0\right)$, and the derivative is defined for $\left(- \infty , \frac{2}{5}\right) \cup \left(\frac{2}{5} , \infty\right)$. At $\left(\frac{2}{5} , 0\right)$, there are two different derivatives depending on which side you approach the limit, and so it is considered undefined.

graph{|5x - 2| [-1, 2, -1.215, 4]}

Jun 21, 2015

I rewrite it as a piecewise defined function and differentiate each piece.

#### Explanation:

$f \left(x\right) = \left\mid 5 x - 2 \right\mid =$ $\left\{\begin{matrix}5 x - 2 & \text{ if " & 5x-2 >= 0 \\ 0 & " if " & 5x-2 =0 \\ -(5x-2) & " if } & 5 x - 2 < 0\end{matrix}\right.$

$= \left\{\begin{matrix}5 x - 2 & \text{ if " & x >= 2/5 \\ 0 & " if " & x =2/5 \\ -5x+2 & " if } & x < \frac{2}{5}\end{matrix}\right.$

For $x > \frac{2}{5}$, we get $f ' \left(x\right) = 5$

For $x < \frac{2}{5}$, we get $f ' \left(x\right) = - 5$

Because the left and right derivatives are different at $x = \frac{2}{5}$, the (two-sided) derivative, $f ' \left(\frac{2}{5}\right)$, does not exist.
(In fact, there is a corner (cusp) at that point.)