I want to have a function called
printRes[expr_,var_], which does the following:
x=1; expr:=a*x^3; result=printRes[expr,x]; result (* derivative of a*x^3 relative to x is 3ax^2, and when x=1, result is 3a. *)
I am unable to put all this into a row after many tries. How do I do it?