I can use Wolfram to derive abs(cos x) and abs(x+2) and abs(ln x) etc. but is there a general derivative for this?
The absolute function is differentiable everywhere except x = 0. This is trivially provable.
$\displaystyle u = |x|,\ and\ x < 0 \implies u(x) = - x \implies u'(x) = \lim_{h \rightarrow 0}\dfrac{u(x + h) - u(x)}{h} = \lim_{h \rightarrow 0}\dfrac{- (x + h) - (- x)}{h} = \lim_{h \rightarrow 0}\dfrac{- x - h + x}{h} = - 1.$
$\displaystyle u = |x|,\ and\ x > 0 \implies u(x) = x \implies u'(x) = \lim_{h \rightarrow 0}\dfrac{u(x + h) - u(x)}{h} = \lim_{h \rightarrow 0}\dfrac{x + h - x}{h} = + 1.$
But $\displaystyle \lim_{h \rightarrow 0^+}\dfrac{|0 + h| - |0|}{h} = \dfrac{h}{h} = 1 \ne -1 = \dfrac{-h}{h} = \lim_{h \rightarrow 0^-}\dfrac{|0 + h| - |0|}{h}$. The limit does not exist at x = 0.
So, by the chain rule, $y(x) = u(v(x)) \implies y'(x) = u'(v) * v'(x)$ unless v(x) = 0.
There is a good explanation of the general derivative here: [SOLVED] Derivative of function involving absolute values