I'm trying to UpSet a certain value for the derivative of a function $Y=Y(l,m,x)$. This can be done by:

D[Y[l_, m_, x_], x_] ^= (l + 1) Y[l, m, x];
D[Y[a, b, c], c]
(*(1 + a) Y[a, b, c]*)

But the problem is, this doesn't always work since for other types of expressions, because Mathematica uses a different form:

D[c *Y[a, b, c], c]
(*Y[a,b,c]+c (Y^(0,0,1))[a,b,c]*)

I've tried solving this with another UpSet, but I get an error.

(Y^(0,0,1))[a_,b_,c_] ^= (l+1) Y[l,m,x]


How can I solve this?

  • $\begingroup$ I did, still the same error if I want to match the arugments. Of course somethings lie Derivative[0,0,1][Y][a,b,c]^= (a+1) Y[a,b,c] works, but only if I use the correct arguments. I want to be able to use any arguments. $\endgroup$
    – Nitaa a
    Sep 26 at 11:05

1 Answer 1



Derivative[0, 0, 1][Y][l_, m_, x_] := (l + 1) Y[l, m, x]
D[c*Y[a, b, c], c]
(*Y[a, b, c] + (1 + a) c Y[a, b, c]*)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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