Re: Log manipulation
- To: mathgroup at smc.vnet.net
- Subject: [mg16883] Re: [mg16804] Log manipulation
- From: dimon at netvision.net.il (Schuster Dmitriy)
- Date: Mon, 5 Apr 1999 02:24:22 -0400
- Organization: NetVision Israel
- References: <7e1b93$b98@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 1 Apr 1999 21:50:11 -0500, Andrzej Kozlowski <andrzej at tuins.ac.jp> wrote: >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/ > Andrezej Kozlowski, have you learnt in Komsomolsk school? Dima