On 04/21/2010 02:12 AM, Jason Grout wrote:
On 04/20/2010 11:32 PM, eric948470 wrote:
Hello,

Suppose I have several equations,

f(a,b,c,d,e) == 0
g(a,b,c,d,e) == 0
h(a,b,c,d,e) == 0

Suppose I want to solve for a, but not have d and e in the solutions.
How would I do that?

In Mathematica I would use,

Solve[ { f(a,b,c,d,e)==0, g(a,b,c,d,e)==0, h(a,b,c,d,e)==0 }, a,
{d,e} ]

How can I do this in Sage?

I guess I have to use the 'solve' function, but I can't figure out
how.


Does this help?

sage: var('a,c,d,e')
(a, c, d, e)
sage: solve([a+c+d+e==0,a-c+2*d-2*e==2,2*a-c-d+3*e==3],[a,c,d])
[[a == -4/3*e + 1, c == -8/9*e - 1, d == 11/9*e]]


Or rather, here is another example closer to an answer to your specific question:


sage: var('a,b,c,d,e')
(a, b, c, d, e)
sage: solve([a+b+c+d+e==0,a-+b^2+c+2*d-2*e==2,2*a-b-c-d+3*e==3],[a,d,e])
[[a == 1/2*b^2 + b + 1/2*c + 5/2, d == -1/8*b^2 - 5/4*b - 9/8*c - 11/8, e == -3/8*b^2 - 3/4*b - 3/8*c - 9/8]]

Thanks,

Jason

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to