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.

I want to give assumptions for the D function. Say I want to calculate $\frac{d|x|}{dx}$ for $x>0$, which is 1.

I write D[Abs[x], x, Assumptions -> x > 0] which gives

D::optx: Unknown option Assumptions in D[Abs[x],x,Assumptions->x>0]. >> Why doesn't D take assumptions?

share|improve this question
6  
Because Assumptions is not a valid option for D[]; see Options[D]. What you want is FullSimplify[D[Abs[x], x], x > 0]. –  J. M. Jul 7 '12 at 4:25
add comment

1 Answer

Many situations where assumptions play a role in differentiations can be equally or more clearly expressed by going back to the Limit defining the derivative in the first place. And Limit does take assumptions.

So for your example, instead of using D, you could write

Limit[(Abs[x + e] - Abs[x])/e, e -> 0, Assumptions -> x > 0]

(* ==> 1 *)

Here I've specified the assumption as an option. Another implicit assumption with Limit is that the small parameter e is taken to be real.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.