julien cubizolles wrote:
> Le samedi 28 novembre 2009 ? 14:55 +0500, Dmitry Vinokurov a ?crit :
>
>> Hello,
>>
>> I've got an equation, for example 'x_1 + x_2 = 0' (of course real case
>> is not so simple, but it's enough for demonstration) and I need to get
>> function F(x_2) from it.
>>
>> I tried to use solve for it 'solve(x_1 + x_2 = 0, x_1)' and get 'x_1 = -
>> x_2'. Now I couldn't find, how to extract right part of solve result
>> into function. Just 'F(x_2) := solve(x_1 + x_2 = 0, x_1)' of course
>> doesn't work, it results to 'x_1 = -x_2' instead of wanted '- x_2'.
>>
>
> You can use :
>
> F(x_2):=sublis(solve(x_1+x_2=0,x_1),x_1);
>
> In some more complex situations, the := function definition won't work
> and you will need to use define, as in :
>
> define(F(x_2),sublis(solve(x_1+x_2=0,x_1),x_1));
>
> I'm not sure exactly why but I just recently found out how to do it.
>
> Julien.
>
>
To Julien:
Thank you very much for quick and right answer.
To all subscribers:
Sorry for previous scrubbed html message. My bad, won't use html more.
--
Best Regards,
Dmitry Vinokurov
<d.vinokuroff at gmail.com>