MathGroup Archive 2011

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

Search the Archive

Re: log expression not simplified

On 17 Jan 2011, at 11:41, Praeceptor wrote:

> Sorry, can anybody help me understand why
> Simplify[Log[a/b]/Log[b/a], Assumptions -> {a > 0, b > a}]
> doesn't reduce to -1 ??
> Thanks (it's for a simple Carnot cycle calculation...)!

Simplify can verify that this is indeed the case

Simplify[Log[a/b]/Log[b/a] == -1,
 Assumptions -> {a > 0, b > a}]


However, it is hard to get it to simplify the expression to -1 because the only way to do so seems to involve temporarily increasing the default complexity. Thus, to get it to work we need a craftily designed custom complexity function, like, for example, this one:

f[expr_] := -2 Count[expr, _Log, {0, Infinity}] + LeafCount[expr]

This function "rewards" Simplify for expanding logs and, in this case, the "incentive" works:

Simplify[Log[a/b]/Log[b/a], Assumptions -> {a > 0, b > a},
 ComplexityFunction -> f]


But trying to find the right function is clearly not worth the effort; a much better way is to use PowerExpand with Assumptions followed by Simplify:

  Assumptions -> {a > 0, b > a}] // Simplify


(Using PowerExpand without Assumptions does not guarantee that the answer is correct).

Andrzej Kozlowski

  • Prev by Date: Re: Help with non-linear system of equations (Trigonometric and Polynomial)
  • Next by Date: Re: question about CUDA
  • Previous by thread: Re: log expression not simplified
  • Next by thread: Re: log expression not simplified