I would like to ask about how to find the derivative of the absolute value function for example :
$\dfrac{d}{dx}|x-3|$
My try:$$ f(x)=|x-3|\\ f(x) = \begin{cases} x-3, & \text{if }x \geq3 \\ 3-x, & \text{if }x \leq3 \end{cases} $$
So: $$f'(x) = \begin{cases} 1, & \text{if }x \geq3 \\ -1, & \text{if }x \leq3 \end{cases} $$
What is wrong with this approcah?.Please clarify. Also I want also like to find out how to integrate the absolute value function.
Thanks
It is almost right..But you have to consider that, at $x=3$, $f(3)=0$.
So:
$$f(x)=\left\{\begin{matrix} x-3, x>3\\ 0, x=3\\ 3-x, x<3 \end{matrix}\right.$$
Therefore,
$$f'(x)=\left\{\begin{matrix} 1, x>3\\ -1, x<3 \end{matrix}\right.$$
EDIT: The derivative does not exist at $x=3$,because:
$$\lim_{h \to 0} \frac{f(3+h)-f(3)}{h}=\lim_{h \to 0} \frac{|h|-|0|}{h}=\lim_{h \to 0} \frac{|h|}{h}$$
The last limit does not exist,because:
$$\lim_{h \to 0^-}\frac{|h|}{h}=-1 \text{ BUT } \lim_{h \to 0^+}\frac{|h|}{h}=+1 $$ The limits are different on either side,so the limit does not exist.
Therefore,the function $f(x)=|x-3|$ is not differentiable at $x=3$.