Ask Your Question

Revision history [back]

click to hide/show revision 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)