Thanks Richard! Now for a follow-up, I have been using ev to evaluate an expression that was first defined in terms of a free variable after the free variable was assigned. For example:
(%i20) area : %pi * radius^2;
(%o20) %pi*radius^2
(%i21) radius : 7;
(%o21) 7
(%i22) area;
(%o22) %pi*radius^2
(%i23) ev(area);
(%o23) 49*%pi
Presumably that would be an acceptable place to use ev, since neither subst nor at will do what I want. Have I got this right?
Thanks!
Jorge
On Jul 5, 2012, at 6:00 PM, Richard Fateman wrote:
On 7/5/2012 2:13 PM, Jorge Calvo wrote:
Hi there:
What is the difference between the commands ev, subst, and at?
1. You should not use ev unless you must. It involves other activities like evaluation of noun
forms, in addition to substitution, so adds to the cost and mystery...
2. subst is better in that it probably does what you want done.
3. try ev(integrate(f(x),x,r,s), x=a) vs at, to see how they differ.
In your examples they do result in the same answers though.