Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Log[Product[]] expansion to Sum[Log[]]?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9210] Re: [mg9160] Log[Product[]] expansion to Sum[Log[]]?
  • From: Allan Hayes <hay at haystack.demon.co.uk>
  • Date: Tue, 21 Oct 1997 02:03:24 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Julian Stoev <stoev at SPAM-RE-MO-VER-usa.net> [mg9160] Log[Product[]]
expansion to Sum[Log[]]?

I want
	Log[Product[SomeFunction[k],{k,1,N}]] to be transformed to
	Sum[Log[SomeFunction[k]],{k,1,N}]

Julian:
Locally we can use
PowerExpand[Log[Product[fn[k],{k,1,3}]]]	
	Log[fn[1]]+Log[fn[2]]+Log[fn[3]]

But this does not work on Log[Product[SomeFunction[k],{k,1,N}]] The
following works automatically	
	
Unprotect[Log];
Log[Product[fn[k],{k,1,n}]] := Sum[Log[fn[k]],{k,1,n}];
Log[HoldPattern[Times[x__fn]]]:=Log/@ Plus[x]; Protect[Log];

Check:
Log[Product[fn[k],{k,1,n}]]
	Sum[Log[fn[k]], {k, 1, n}]

Log[fn[1] fn[2]]
	Log[fn[1]] + Log[fn[2]]

Log[fn[1]]
	Log[fn[1]]
	
Log[Times[]]
	0
	
Allan Hayes
hay at haystack.demon.co.uk
http://www.haystack.demon.co.uk/training.html voice:+44 (0)116 2714198
fax: +44 (0)116 2718642
Leicester,  UK


  • Prev by Date: Re: Re: Divergence and Dirac Delta Function
  • Next by Date: live and movie for SGI
  • Previous by thread: Log[Product[]] expansion to Sum[Log[]]?
  • Next by thread: Re: Log[Product[]] expansion to Sum[Log[]]?