teaching Maxima logarithms



Very impressive, Barton!  I have two related questions:

1. I found that the Maxima Manual mentions the optional variable %e_to_numlog:

When true, r some rational number, and x some expression, %e^(r*log(x)) will be simplified into x^r .

That sounds like what is required here (and essentially what Barton's function is doing).  However, I can't get this variable to work properly.  With it set to true or false, I still get:

(%i92) %e_to_numlog : false;
(%o92) false

(%i93) %e^(y*log(10));
(%o93) %e^(log(10)*y)

(%i94) exp(y*log(10));
(%o94) %e^(log(10)*y)

(%i95) %e_to_numlog : true;
(%o95) true

(%i96) %e^(y*log(10));
(%o96) %e^(log(10)*y)

(%i97) exp(y*log(10));
(%o97) %e^(log(10)*y)

What am I missing here?

2. Bill's email (using radcan to get to the solution x = 2^y*5^y) prompts the question of whether there is a way to contract a product of exponentials, i.e., something like:

(i%??) expcontract(2^y*5^y)
(o%??) 10^y

I realize that this can't work in general (if y=1/2 (-1)^y*(-1)^y is not the same as 1^y) but is there some function like this lying around the Manual that I haven't found?

Thanks!

Jorge

--
Dr. Jorge Alberto Calvo
Associate Professor of Mathematics
Department of Mathematics and Physics
Ave Maria University

Phone: (239) 280-1608
Email: jorge.calvo at avemaria.edu<mailto:jorge.calvo at avemaria.edu>
Web: http://sites.google.com/site/jorgealbertocalvo

-----
Date: Thu, 16 May 2013 02:24:43 +0000
From: Barton Willis <willisb at unk.edu<mailto:willisb at unk.edu>>
To: "bill.wood at acm.org<mailto:bill.wood at acm.org>" <bill.wood at acm.org<mailto:bill.wood at acm.org>>, Bill Eaton
<wpeaton4 at gmail.com<mailto:wpeaton4 at gmail.com>>
Cc: "maxima at math.utexas.edu<mailto:maxima at math.utexas.edu>" <maxima at math.utexas.edu<mailto:maxima at math.utexas.edu>>
Subject: Re: [Maxima] teaching Maxima logarithms
Message-ID:
<83FD4DC40F97654495E2C9AED4765836359E85D6 at BLUPRD0712MB595.namprd07.prod.outlook.com<mailto:83FD4DC40F97654495E2C9AED4765836359E85D6 at BLUPRD0712MB595.namprd07.prod.outlook.com>>

Content-Type: text/plain; charset="us-ascii"

The function radcan does more than exp(log(x)) --> x. Some of these things might not be desired.
An alternative

exp_log_to_power(e) := block( [logconcoeffp : lambda([s],true)],
  subst("^" = lambda([a,b], if a = %e and ?mlogp(b) then first(b) else funmake("^",[a,b])), logcontract(e)));

(%i23) exp_log_to_power(x = %e^(log(10)*y));
(%o23) x=10^y

But logcontract might do things that aren't desired either--if so adjust logconcoeffp.
The call to ?mlogp is a poor practice. So it goes.

--Barton

________________________________________
From: Bill Wood [william.wood3 at comcast.net<mailto:william.wood3 at comcast.net>]
Sent: Wednesday, May 15, 2013 20:33
To: Bill Eaton
Cc: Barton Willis; maxima at math.utexas.edu<mailto:maxima at math.utexas.edu>
Subject: Re: [Maxima] teaching Maxima logarithms

On Wed, 2013-05-15 at 18:04 -0700, Bill Eaton wrote:
  . . .
That definitely works, but my desire is to strip off any vestiges of e or
log(10) in the output. What I would really like to see is:
 (%o8) [x=10^y)]
or more generally
 (%o8) [x={base n}^y]

For What It's Worth, which is probably not so much, we can get close:

 (%i1) display2d:false$

 (%i2) eq : y = log10(x);

 (%o2) y = log10(x)
 (%i3) log10_to_log(ex) := subst(lambda([x],log(x)/log(10)),'log10,ex)$

 (%i4) log10_to_log(eq);

 (%o4) y = log(x)/log(10)
 (%i5) solve(%,x);

 (%o5) [x = %e^(log(10)*y)]
 (%i6) x = radcan(part(%o5,1,2));

 (%o6) x = 2^y*5^y

RADCAN overshot just a little, but at least there's no log10 or %e.  I
have no idea whether this generalizes, or how.

--
Bill Wood