Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

log expression not simplified

575 views
Skip to first unread message

Praeceptor

unread,
Jan 17, 2011, 5:41:35 AM1/17/11
to
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...)!

Sjoerd C. de Vries

unread,
Jan 18, 2011, 5:46:12 AM1/18/11
to

I don't know why Simplify can't do it, but PowerExpand first and then
Simplify does the job.

Cheers -- Sjoerd

I don't know why Simplify can't do it, but PowerExpand first and then
Simplify does the job.

Cheers -- Sjoerd

Peter Pein

unread,
Jan 18, 2011, 5:46:45 AM1/18/11
to

Hi,

you can use

In[1]:= Cancel[PowerExpand[Log[a/b]/Log[b/a]]]
Out[1]= -1

but please read the documentation to mind possibly unwanted effects.

This:

In[2]:= Assuming[b > a > 0,
FunctionExpand[Log[a/b]/Log[b/a]] // Refine // Cancel]
Out[2]= -1

is a bit more typing but should be mathematically carrect in any case.

Peter

Bob Hanlon

unread,
Jan 18, 2011, 5:47:06 AM1/18/11
to

I don't know why it doesn't work; however, you can force it with PowerExpand

Log[a/b]/Log[b/a] // PowerExpand // Simplify

-1


Bob Hanlon

---- Praeceptor <gianluca...@poste.it> wrote:

=============

Murray Eisenberg

unread,
Jan 18, 2011, 5:47:28 AM1/18/11
to
I'm not sure why that doesn't work, but what does is:

Simplify@PowerExpand[Log[a/b]/Log[b/a]]

On 1/17/2011 5:41 AM, Praeceptor wrote:
> Simplify[Log[a/b]/Log[b/a], Assumptions -> {a> 0, b> a}]

--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305

Emil Hedevang

unread,
Jan 18, 2011, 5:48:34 AM1/18/11
to
Try with

Log[a/b]/Log[b/a] // PowerExpand // Simplify

In my experience the simplification functions in Mathematica sometimes need help from one of the *Expand functions.

-- Emil Hedevang

Michael Weyrauch

unread,
Jan 18, 2011, 5:51:09 AM1/18/11
to
The following works and produces -1 as a result

Simplify[FullSimplify[ComplexExpand[Log[a/b]/Log[b/a]]],
Assumptions -> {a > 0, b > 0}]

Its probably so complicated because of the cut of Log[] on the real axis
(in the complex plane).

Michael

Bill Rowe

unread,
Jan 18, 2011, 5:51:42 AM1/18/11
to
On 1/17/11 at 5:41 AM, gianluca...@poste.it (Praeceptor) wrote:

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

>doesn't reduce to -1 ??

I don't have a good answer to your question but you can achieve
what you want with

In[8]:= Log[a/b]/Log[b/a] // PowerExpand // Simplify

Out[8]= -1


Andrzej Kozlowski

unread,
Jan 18, 2011, 5:53:00 AM1/18/11
to

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}]

True

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]

-1

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:

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

-1

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

Andrzej Kozlowski

Alexei Boulbitch

unread,
Jan 19, 2011, 5:22:48 AM1/19/11
to
Try this:

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


-1


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...)!

--
Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 CONTERN
Luxembourg

Tel: +352 2454 2566
Fax: +352 2454 3566
Mobile: +49 (0) 151 52 40 66 44

e-mail: alexei.b...@iee.lu

www.iee.lu

--

This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended
recipient and have received this e-mail in error, you are hereby
notified that any review, copying or distribution of it is strictly
prohibited. Please inform us immediately and destroy the original
transmittal from your system. Thank you for your co-operation.


Praeceptor

unread,
Jan 22, 2011, 3:22:25 AM1/22/11
to
Thanks to everybody contributing to this thread. In particular to
Andrzej who turned my attention to the use of complexity functions in
mathematica's simplifying tools.

On 18 Gen, 11:53, Andrzej Kozlowski <a...@mimuw.edu.pl> wrote:

> [...]
> However, it is hard to get it to simplify the expression to -1 because th=
e only way to do so seems to involve temporarily increasing the default com=
plexity. Thus, to get it to work we need a craftily designed custom complex=


ity 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, th=


e "incentive" works:
>
> Simplify[Log[a/b]/Log[b/a], Assumptions -> {a > 0, b > a},
> ComplexityFunction -> f]
>
> -1
>

> [...]
>
> Andrzej Kozlowski

0 new messages