Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
    
Replace log by Log (first letter=Uppercase) –  andre Feb 8 '13 at 14:21

1 Answer 1

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

share|improve this answer
    
Thanks. It did occur to me it was using natural logs but being able to specify assumptions on Simplify is very useful. –  David McHarg Feb 8 '13 at 15:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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