I'm new in Mathematica so this is maybe super easy to do, but I can't figure out how.
I've got a function
plus[a,b] that sums two numbers and I need to implement a function
derivation[a] that will derive the input like this:
derivation[e_Integer] (* returns 0 *) derivation[x] (* returns 1 *)
I've got a problem with this rule:
derivation[plus[a, b]] := plus[derivation[a], derivation[b]];
When I implement it this way, it doesn't work because plus is evaluated before derivation. I.E.
derivation[plus[x, 3]] should return
1. Is there some other way how to implement it?