Re: Problem with replacement rules
- To: mathgroup at smc.vnet.net
- Subject: [mg91882] Re: Problem with replacement rules
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Thu, 11 Sep 2008 06:17:36 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <ga82r6$re7$1@smc.vnet.net>
Simula wrote: > Hello, I have a very simple question but I didn't find an answer in mathematica help. > I use Solve[expression(x,y),x]. Then, x is obtained as a one-to-one function of y. I want to define the function x(y) using the output of Solve. How should I do? In[1]:= (* Solve the expression for x and save the result in sol *) sol = Solve[a * x + y == 7, x] (* Define x as a function of y *) x[y_] = x /. sol[[1]] (* Use the function *) x[10] Out[1]= {{x -> (7 - y)/a}} Out[2]= (7 - y)/a Out[3]= -(3/a) Regards, -- Jean-Marc