Maxima CAS: How to force log() into a product?

61 Views Asked by At

Is there a simplification way to turn log of a product into a sum of logs in Maxima CAS? I tried radcan(), but it does not change the expression. See the toy example: TryItOnline

f:log(product(exp(X[i]-mu),i,1,n));
print(f);
print(radcan(f));

both prints return:

      n
    /===\   X  - mu
     ! !     i
log( ! !  %e       ) 
     ! !
    i = 1
      n
    /===\   X  - mu
     ! !     i
log( ! !  %e       ) 
     ! !
    i = 1
1

There are 1 best solutions below

0
On

Just found logexpand variable, which is opposite to logcontract:

logexpand:all;
f:log(product(exp(X[i]-mu),i,1,n));
print(f);
print(radcan(f));

produces:

 n
====
\
 >    (X  - mu) 
/       i
====
i = 1
 n
====
\
 >    (X  - mu) 
/       i
====
i = 1