[tex]\frac{d}{dx}|\cos(x)|=-\frac{|\cos(x)|}{\cos(x)}\sin(x)[/tex]
Note that the signum function can be defined by [tex]sgn(x)=\frac{|x|}{x}[/tex] for nonzero x, and is zero when x is zero. The signum function cannot be use in this case as [tex]|\cos(x)|[/tex] is not differentiable at the values of x for which [tex]\cos(x)=0[/tex] as the lefthand and righthand derivative are not equal there (by lefthand or righthand derivates, what is meant is the left or right-handed limit of the difference quotient at a particular value of x).
Thank you so much. I've never even heard about the signum function before until now. How would I go about taking higher order derivatives of the signum function like the second and third, etc. How does that work?