Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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

Your Answer


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.