Hi, I wonder if there is an easy way to multiply the numerator and 
denominator of a rational expression by the same factor. I'd like to do 
this to group terms so that I can make a substitution.

I tried making a function to do this:

def tb(exp,factor):
    if exp.func==Mul and exp.args[-1].func==Pow \
        and exp.args[-1].args[-1]==-1:
        e=exp*factor
        denom=e.args[-1].args[0] * factor
        e.args[-1].args[0] = denom
        
    return e



Unfortunately it doesn't work because of immutable tuples.


-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/773995c5-ed93-42cd-a480-2e59bb9f4974%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to