MathGroup Archive 2010

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

Search the Archive

Re: Simplifying Logs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113122] Re: Simplifying Logs
  • From: gekko <pfalloon at gmail.com>
  • Date: Wed, 13 Oct 2010 23:27:05 -0400 (EDT)
  • References: <i93k7o$e4s$1@smc.vnet.net>

On Oct 13, 5:39 pm, Themis Matsoukas <tmatsou... at me.com> wrote:
> This works as expected and combines the logs:
>
> Simplify[Log[a] - Log[b], Assumptions -> {a > 0, b > 0}]
>
> Log[a/b]
>
> But this doesn't:
>
> Simplify[1 + Log[a] - Log[b], Assumptions -> {a > 0, b > 0}]
>
> 1 + Log[a] - Log[b]
>
> This seems inconsistent to me. I suppose I would like to see a CombineLog=
s command in the future.
>
> Themis

This is an interesting example. The reason Mathematica doesn't combine
the logs in the second case is that it doesn't consider that the
original expression is any simpler than the original one. The exact
details of why depend on the definition of the default
ComplexityFunction used by Simplify (an implementation of this is
given in the function SimplifyCount, defined in the help menu page for
ComplexityFunction, under the "Properties & Relations" tab). You could
specify an alternative ComplexityFunction, but probably the simplest
is to use a custom rule to perform the desired simplification, e.g.

In[1] := 1 + 2 Log[a] - 3 Log[b] /. x_. Log[a_] + y_. Log[b_] :>
Log[a^x b^y]

Out[1] = 1 + Log[a^2/b^3]


  • Prev by Date: Re: Simplifying Logs
  • Next by Date: Re: local variables - Module, For loop
  • Previous by thread: Re: Simplifying Logs
  • Next by thread: Re: Simplifying Logs