ok...i was not clear.f(x):= x^2;i(y):= rhs(last( solve(f(x)=y,x)));i(2);i(3);i(4); --> it shoud be sqrt(y);sqrt(y);sqrt(y);
thanks.
Date: Wed, 18 Dec 2013 12:19:18 -0500
Subject: Re: [Maxima] define and := (basic)
From: macrakis at alum.mit.edu
To: rcrdjf at hotmail.com
CC: maxima at math.utexas.edu
On Wed, Dec 18, 2013 at 11:53 AM, Ricardo JF <rcrdjf at hotmail.com> wrote:
f(x):= x^2;i(y):= rhs(last( solve(f(x)=y,x)));i(2);i(3);i(4);
I'm not entirely sure I understand what you're asking. In particular, saying "doesn't work as expected" isn't very explicit: what were you expecting?
But if I'm understanding your question correctly...
In your first example, the variable 'y' is bound by the function. In the second it isn't. Here is a simpler example:
q(w):=w$
q(2) => 2
val: w$
r(w):= val$r(2) => val (not 2)