Re: combining Log[] terms

*To*: mathgroup at smc.vnet.net*Subject*: [mg30488] Re: combining Log[] terms*From*: Hendrik van Hees <h.vanhees at gsi.de>*Date*: Fri, 24 Aug 2001 04:05:49 -0400 (EDT)*Organization*: GSI Darmstadt*References*: <9m281v$h28$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Nicolas Bock wrote: > Is there a function that combines terms like > > Log[a] - Log[b] > > to > > Log[a/b]? > > I couldn't find anything so far in the documentation regarding the > Log[] function, only some references to Collect[], which does > something similar to what I want for powers of a given expression. Fortunately Mathematica does not combine logs in the way you like to do. The point is that this manipulations are only valid for real quantities in general not for complex ones. If you have only positive real numbers as arguments in your log-terms you can use simple pattern matching constructs to force Mathematica to combine logarithms, for instance: In[1]:= -Log[a] + Log[b] /. {Log[x_] - Log[y_] -> Log[x/y]} b Out[1]= Log[-] a -- Hendrik van Hees Home: http://theory.gsi.de/~vanhees/ c/o GSI-Darmstadt SB3 3.183 FAQ: http://theory.gsi.de/~vanhees/faq/ Planckstr. 1 D-64291 Darmstadt mailto:h.vanhees at gsi.de