| 1 | initial version |
You can save the equation in a variable and apply it through the .subs method. Try, for example, the following code:
var("a,b,c")
eq = a+b+c==1
print (a^2 + 2*a*b + b^2 + 2*a*c + 2*b*c + c^2).factor().subs(eq)
print (1/a + 1/b + c/(a*b)).simplify_rational().subs(eq)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.