Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Derivative of the Abs Function in Mathematica looks very different than the actual answer. Why? How to correct this?

For example I entered D[Abs[x - 1], x] and got the output Abs'[-1 + x]. Is there a syntax error in my input?

share|improve this question
    
FullSimplify[D[Abs[x - 1], x], x \[Element] Reals && x != 0] Resolve[ForAll[x, x \[Element] Reals && x != 0, Sign[-1 + x] == Piecewise[{{1, x - 1 > 0}, {-1, x - 1 < 0}}]], Reals] –  rasher May 1 at 7:29
    
How do I get the output in this form: (x−1)/|x−1| ? –  user14056 May 1 at 7:34
1  
Throw a rule and traditionalform onto end of simplify, /. Sign[z_ - 1] :> (z - 1)/Abs[z - 1] // TraditionalForm or investigate ComplexityFunction and TransformationFunctions for simplify. Bottom line, the form presented is what Mathematica deems the "simplest". If you need/want to transform it, you need to tell it so. –  rasher May 1 at 7:41
    
Thanks! ComplexExpand followed by Simplify helped. –  user14056 May 1 at 15:11
2  
You need ComplexExpand probably because you can't take the derivative of Abs in the complexes –  Rojo May 1 at 15:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.