Re: Log manipulation
- To: mathgroup at smc.vnet.net
 - Subject: [mg16850] Re: [mg16804] Log manipulation
 - From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
 - Date: Thu, 1 Apr 1999 21:35:23 -0500
 - Sender: owner-wri-mathgroup at wolfram.com
 
On Tue, Mar 30, 1999, Pierre infelta <pierre.infelta at epfl.ch> wrote:
>I am sure this is a classic but I don't seem to find the answer.
>
>I am looking for the command that will do the opposite of powerExpand
>for the Log function.
>
>If I have 
>
>PowerExpand[Log[a*b]]
>I get 
>
>Log[a] +Log[b]
>
>Is there a command that does the opposite?
>
>Command[Log[a] + Log[b]]
>
>to get
>
>Log[a b]
>
>as an answer
>
>Thanks
I can't think of a built-in command that would do that but it is easy to
create one yourself. For example:
In[1]:=
CollectLogs[x_]:=Log[Simplify[E^x]]
In[2]:=
CollectLogs[Log[x]+Log[y]]
Out[2]=
Log[x y]
This also works with the difference instead of sum of logs:
In[3]:=
CollectLogs[Log[x]-Log[y]]
Out[3]=
    x
Log[-]
    y
and  with powers
In[4]:=
CollectLogs[n*Log[x]]
Out[4]=
     n
Log[x ]
Andrzej Kozlowski
Toyama International University
JAPAN
http://sigma.tuins.ac.jp/
http://eri2.tuins.ac.jp/