ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 28 Jan 2018 18:20:33 +0100What is the opposite of log_expandhttps://ask.sagemath.org/question/40820/what-is-the-opposite-of-log_expand/ log_expand does converts log(x*y) to log(x)+log(y). Is there a function which explicitly reverts this?
Sun, 28 Jan 2018 13:13:58 +0100https://ask.sagemath.org/question/40820/what-is-the-opposite-of-log_expand/Answer by tmonteil for <p>log_expand does converts log(x*y) to log(x)+log(y). Is there a function which explicitly reverts this?</p>
https://ask.sagemath.org/question/40820/what-is-the-opposite-of-log_expand/?answer=40826#post-id-40826Yes, `log_simplify`:
sage: e = log(x*y) ; e
log(x*y)
sage: f = e.log_expand() ; f
log(x) + log(y)
sage: f.log_simplify()
log(x*y)
Note that given an sage object `e`, you can see all methods that can be applied to it, by typing `e.<TAB_BUTTON>`, and the methods that start with `blah` by typing `e.blah<TAB_BUTTON>`, in particular, you could discover both methods by typing:
sage: e.log<TAB_BUTTON>
Sun, 28 Jan 2018 18:20:33 +0100https://ask.sagemath.org/question/40820/what-is-the-opposite-of-log_expand/?answer=40826#post-id-40826