MathGroup Archive 2001

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

Search the Archive

Re: Automatic expansion of Log[a^n] for a,n explicit positive integers?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28229] Re: [mg28180] Automatic expansion of Log[a^n] for a,n explicit positive integers?
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Thu, 5 Apr 2001 03:00:44 -0400 (EDT)
  • References: <200104030637.CAA20052@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

If you are only concerned about powers of 2, then you may define the
functiion lg and use it always instead of Log:

In[1]:=
lg[n_] := If[Mod[n, 2] == 0, IntegerExponent[n, 2]*Log[2], Log[n]]

Then, e.g.,

In[1]:=
{lg[2], lg[4], lg[8], lg[16], lg[32], lg[3]}
Out[1]=
{Log[2], 2 Log[2], 3 Log[2], 4 Log[2], 5 Log[2], Log[3]}

Tomas Garza
Mexico City
----- Original Message -----
From: "Harald Anlauf" <anlauf at hep.tu-darmstadt.de>
To: mathgroup at smc.vnet.net
Subject: [mg28229] [mg28180] Automatic expansion of Log[a^n] for a,n explicit positive
integers?


> Hi,
>
> is there a way to force Mathematica 4.0 to always expand expressions like
>
> Log[4], Log[8], Log[16], etc. to 2*Log[2] etc.
>
> automatically?
>
> It is very annoying to have such logarithms expanded manually each
> time they pop up again...
>
> PowerExpand[] apparently does not help/work.
>
> --
> Ciao,
> -ha
>



  • Prev by Date: InputAliases
  • Next by Date: Re: complex coefficients and rules...
  • Previous by thread: Automatic expansion of Log[a^n] for a, n explicit positive integers?
  • Next by thread: Re: Automatic expansion of Log[a^n] for a, n explicit positive integers?