4
$\begingroup$

Have been experimenting with the Log function to demonstrate simple Log relationships such as Log[xy], Log[x+y] etc.

Clear[x,y,m,n];
m =b^x;
n = b^y;
Log[b,m]+Log[b,n] 

The output i get is

log(b^y)/log(b)+log(b^x)/log(b)

Why is Log[b,b] not being evaluated to 1 ? Also Log[b,b^x]=x so why is it not showing this ? Also the log statements in the output have no base shown ?

I tried

Log[b,m]//Trace

which gives me

Result

Simplify doesn't seem to do anything

Thanks David.

$\endgroup$
1
  • $\begingroup$ Replace log by Log (first letter=Uppercase) $\endgroup$
    – andre314
    Commented Feb 8, 2013 at 14:21

1 Answer 1

10
$\begingroup$

Log[b, b] does evaluate to 1; your error is in assuming that Log[b, b^x] is supposed to simplify automatically to x; Mathematica assumes that symbols like b and x are generically complex numbers unless told otherwise, and you should know that $\log_b b^x\neq x$ in a large region of the complex plane.

However, you can use Simplify[] and assumptions:

Simplify[Log[b, b^x], Positive[b] && Element[x, Reals]]
(* x *)

FWIW: you are aware of the change-of-base formula? Mathematica, for a number of reasons, prefers that all logarithms be expressed as natural logarithms $\log\,x$ ($\ln\,x$ in less-advanced work), and does so. So, Log[b, x] is automagically transformed to Log[x]/Log[b]. Similar transformations are done for Log2[x] and Log10[x].

$\endgroup$
1
  • $\begingroup$ Thanks. It did occur to me it was using natural logs but being able to specify assumptions on Simplify is very useful. $\endgroup$ Commented Feb 8, 2013 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.