I am trying to get the following two expressions to combine under addition: e1 = rf*(1 - (c5*s2 + c2*s4*s5)**2)**(-0.5) e2 = rf*(-c5*s2 - c2*s4*s5)*(1 - (c5*s2 + c2*s4*s5)**2)**(-0.5)
Is there a way to make the add combine these to obtain the result: rf*(1 - (c5*s2 + c2*s4*s5))*(1 - (c5*s2 + c2*s4*s5))**(-0.5) which would automatically simpify even further to: rf*(1 - (c5*s2 + c2*s4*s5))**(0.5) It seems like this could be made automatic if Add could look at the hash of each of the arguments of its arguments, and if any of them were equal, they could be made to combine 'automatically'. It is interesting that Mul can auto combine things like: rf*(1 - (c5*s2 + c2*s4*s5))*(1 - (c5*s2 + c2*s4*s5))**(-0.5), but Add does not. Would this be hard to implement in Add? Thanks, ~Luke --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---