+ (plus) is represented by "+" - (minus) is represented by "-" * (product) is represented by "*" / (division) is represented by "/" ^ (exponentiation) is represented by "^"
D(u^n) = n*u^(n-1)*Duis actually valid also for n=0 (originally the case 0 was excluded). So you should not test that n is different from 0 when you define this case. However, it is valid only when n is a number (not a function of x). This means that when you define this case, you have to write a line like
| deriv (Opr("^",u,Num n), x) = ...This will give you a "match nonexhaustive" warning, but that's ok. On the contrary, allowing the third argument of Opr to be a generic expression, in this definition, will be considered an error.
Dz = 0 if z is a number or a variable different from x Dx = 1 D(u+v) = Du + Dv D(u-v) = Du - Dv D(u*v) = v*Du + u*Dv D(u/v) = (v*Du - u*Dv) / (v^2) D(u^n) = n*u^(n-1)*Du where n is a numberNamely, do not change the order in which the argument of an operator are written, like for instance Dv*u instead of u*Dv. Although these expressions are theoretically equivalent, they produce a different symbolic output, and it would make the correction difficult for the TA.
1 ace 2 numbered 2 3 numbered 3 4 numbered 4 5 numbered 5 6 numbered 6 7 numbered 7 8 numbered 8 9 numbered 9 10 numbered 10 11 jack 12 queen 13 kingyou can assume that the function smaller is never applied to "non-cards", like for instance (numbered 11)