Try *factor*( ) In [1]: log(25) Out[1]: log(25)
In [2]: factor(log(25)) Out[2]: 2*log(5) To apply it only to logarithm expressions: In [6]: l = log(25) In [7]: l.replace(lambda expr: isinstance(expr, log), lambda expr: factor( expr)) Out[7]: 2*log(5) On Monday, 19 October 2015 11:32:34 UTC+2, Paul Royik wrote: > > simplify(2log(5)) returns log(25) > How to revert this? > > On Monday, October 19, 2015 at 10:35:45 AM UTC+3, Francesco Bonazzi wrote: >> >> >> >> On Monday, 19 October 2015 07:12:46 UTC+2, Paul Royik wrote: >>> >>> Hello. >>> I noticed that simplify moves coefficient of logarithm under logarithm: >>> 2*log(5)=log(5**2)=log(25). >>> >>> >> Are you sure it does? >> >> I get this: >> >> In [2]: 2*log(5) >> Out[2]: 2*log(5) >> >> In [5]: log(25) >> Out[5]: log(25) >> >> >> >> -- 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 http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/62c849af-c59f-454c-86d7-db08f0299fba%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
