teaching Maxima logarithms



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]
Sent: Wednesday, May 15, 2013 20:33
To: Bill Eaton
Cc: Barton Willis; 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