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