I'm trying to simplify a*cos(b)**2+a*sin(b)**2 to a So, I write
a = sympy.Wild('a') b = sympy.Wild('b') expr = 49*cos(x)**2+49*sin(x)**2 + 5 expr.replace(a*sympy.sin(b)**2+a*sympy.cos(b)**2, a, exact=True) But this doesn't work. expr is unchanged. -- 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 sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. 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/ad070b63-17ad-485f-b1e1-4ccd9c4cbc4f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.